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!

Populating Combo Box DAO Dode

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Anyone know how I populate a Combo Box with DAO code? I have a form when the user selects a category I am going to show them a drop down with values I query once they select a category. Also any idea how to do this. How on a regular form can I flag a field once the user clicks the New button to save the record?
 
I dont see the .AddItem property when I try doing that add item.
 
Hi,
You don't have the addItem method here. To have a list of values, you must first set the RowSourceType property of the combo box to "Value List".

Then construct a string with the items that you want to appear in the combo box as a ; separated string.

Eg. strCarNames = "Benz;Ferrari;BMW"

Now you can assign this string to the RowSource property of the combo box as follows:

Me.Combo1.RowSource = strCarNames

Hope it helps. Post back if you want anything else.


With regards,
PGK
 
Hi,
After you have assigned to the RowSource property of the list box, use the requery method.

Me.Combo1.RowSource= strCarNames
Me.Combo1.Requery

With regards,
PGK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top