Dynamic Forms VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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 would make the fields Text Boxes instead of Labels and then populate the
text boxes based on the query
 
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?


You could try using text boxes (instead of labels with
expressions like:
=Form.Recordset.Fields(x).Name

Then your query can alias each field to whatever you want to
display.

But I really must seriously worry about you creating a form
in a running application. It is a disaster waiting to
happen, is not even allowed in an MDE and is not necessary.
 
Back
Top