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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamically set values for a combo box

Status
Not open for further replies.

striker73

MIS
Jun 7, 2001
376
US
I want to be able to dynamically set the values for my combo box and I am unclear on the syntax. Statically, I can set the rowsource equal to:

"Client" ; "Facility" ; "Contractor" ; "Regulatory Agency" ; "Laboratory"

However, I want to do this in my code and access doesn't like the semi-colon very much. Any ideas? Thanks!
 
a-HAH! I figured it out. You have to add quotation marks, which VBA doesn't like, so you have to use ascii code like this:

cboContactType.RowSource = Chr(34) & "Client" & Chr(34) & ";" & Chr(34) & "Facility" & Chr(34) & ";" & Chr(34) & "Contractor" & Chr(34) & ";" & Chr(34) & "Regulatory Agency" & Chr(34) & ";" & Chr(34) & "Laboratory" & Chr(34)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top