Dynamic Forms

D

dmericksen

I am trying to create a dynamic form. Here is how it works: the user selects
a query, and hits submit on a menu form. A form is then created and the
record source is assigned based on the users initial query selection. Now
the question/problem:

Once the form is loaded, all of the captions/labels are generic. I would
like to change this using vba. Is there any way to get column header
information on the query programmatically?

Ideas?
 
J

James A. Fortune

dmericksen said:
I am trying to create a dynamic form. Here is how it works: the user selects
a query, and hits submit on a menu form. A form is then created and the
record source is assigned based on the users initial query selection. Now
the question/problem:

Once the form is loaded, all of the captions/labels are generic. I would
like to change this using vba. Is there any way to get column header
information on the query programmatically?

Ideas?

I posted some (rough) form creation code here:

http://groups.google.com/group/microsoft.public.access/msg/0fd179f25848911f

If I'm not mistaken, it sounds like you want to look at the Fields
collection of the QueryDef object to obtain the names of the fields to
use within control names on your dynamic form. Including the query name
as a hidden column in the combobox is a simple way to obtain the chosen
QueryDef name.

James A. Fortune
[email protected]
 
Top