Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add an optional box in to form from vba code?

Status
Not open for further replies.

xq

Programmer
Jun 26, 2002
106
NL
i'm thinking of create a form which will provide a list of records that is select from a table under certain condition, and each record is present in optional box format, and let user to choose, once records on the form are choosed by clicking and ADD command button is clicked, those records will be updated in some way.
cos everytime the form is open, those records wonn't be the same as last time. so if i want to the way i said above, that means i have to create optional box from vb code instead create it directly on the form. is that possible?
thanks million for any help!
 
xq
you can try this :

in your form you create several boxes a1,a2,a3,...
but all .visible = false

strSQL="select field1 as a1, field2 as a2 ... (dynamic)
from tab where ..." ' what ever you want.

depending on the fields you select you do
a1.visible = true
a2.visible = true
etc.

If your problem is the number of records you receive,
try a subform with an add button on each row.

- FirstDirk



 
thank u! FirstDirk, but i don't really get what 'an subform with an add button on each row' is, all user have to do is to click to choose the record that r shown on the form which is done by program, the number of record is the problem. what should i do with that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top