DatasheetDynamicColumns.mdb |
Post Reply |
Author | |
A.D. Tejpal
Microsoft MVP Joined: 30 Jun 2008 Status: Offline Points: 192 |
Post Options
Thanks(0)
Posted: 09 Jul 2008 at 10:56pm |
This sample db demonstrates manipulation of datasheet columns (their numbers, headings, control-source, column order, width etc) so as to suit run-time change of record-source. On opening the main form, it grabs the names of all available tables and queries, and loads them in the row-source for the combo box. At this stage the main subform has five columns on display, all unbound, with generic headings. There is no record- source yet, for the subform. As soon as a source table or query is selected in the combo box, the subform at right (serving as field list), gets populated with names of fields in the selected table/query. Out of these, the user can click the check boxes for selecting the fields required to be loaded in the main subform. On clicking the update button, the subform gets loaded with appropriate record- source and the controls get bound to respective fields. The columns are displayed in proper order, with headings matching the field names. If the number of fields selected in the field list is less than the number of controls available, the unused columns remain unbound and get hidden. Widths of displayed columns get adjusted automatically, so as to match the overall width of subform control. References - DAO 3.6
|
|
Sponsored Links | Want a good read? Try The Summer of His Life (available on Amazon!) |
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |