Print Page | Close Window


Printed From: Roger's Access Library
Category: Other Download Libraries
Forum Name: Tejpal, A.D.
Forum Description: A.D. Tejpal's Library
Printed Date: 26 Jan 2021 at 1:46pm
Software Version: Web Wiz Forums 12.03 -

Topic: DatasheetDynamicColumns.mdb
Posted By: A.D. Tejpal
Subject: DatasheetDynamicColumns.mdb
Date 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 

Download Access XP & 2K: - uploads/37/


Email: -

Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.03 -
Copyright ©2001-2019 Web Wiz Ltd. -