Access 2000 - how to dynamically create a form at runtime based on a query

  • Thread starter Thread starter sheree
  • Start date Start date
S

sheree

I would like to dynamically generate a form at runtime based on query
results. What I would like to do is this: I have a table called Event
which contains only 2 fields: EID and Symptom. I would like to create
a form (with a specific name) that contains a series of checkboxes and
corresponding labels -- one for each record in the Event table. The
label should be exactly the same as the Symptom field (char field).
And the checkbox should be unbound, but should carry the name of the
EID. Ideally, I would like these to show up in 3 columns on the form
(along with a couple other controls that I will worry about later).

I don't even know where to begin with this for the syntax. Any code
samples you could show me would be great! Thanks so much for your
time.
 
Hi,

And using a subform, as a starting point is appealing? You can make the
edit box SpecialEffect: flat, and backStyle: transparent, plus Locked=True
and Enabled=False ... and it will look like a label! You can also format
the SubForm control itself so it will "merge" naturally with the main form,
as if there was not subform there...

Hoping it may help,
Vanderghast, Access MVP
 
Michael, I'm not sure I understand your suggestion. Could you give me a
little more detail?
Thanks for your help!
-sheree
 
Hi,


Rather than relaying on controls that requires an individual instance
per information, in case the number of information is unknown, it is
preferable to relay on lists, built for a variable amount of data. As
example, is you use radio button, you need exactly one per item, while if
you use a combo box, you need just one combo box, no more, whatever is the
number of individual information you need to display. Same for a subform:
there is need of just one subform, for any number of individual information
you need. A subform can allow you to repeat "many" controls, like a check
box and one, or many, edit text box, etc, per individual information
(record). So, in you case, it is a matter to get one check box and one edit
text box turned like a label.



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top