Combobox with values in fields

Pslice

Registered User.
Local time
Today, 03:11
Joined
Jan 26, 2012
Messages
16
I have a combobox1 on form1 that has "fields" from table1 as its values, I want another combobox2 on the same form1 to populate with the values based on the fields in combobox1
 
Perhaps you need cascading combo boxes. Take a look at: fontstuff.com/access/acctut10

This does help me, but I'm looking for a way to make a field name variable in a sql statement in vba.
something like

Code:
Dim strField as String
strField = Me.Combobox.Value

"SELECT tblFields.strField " & _
 
Can you tell us a little more of what you are trying to do.
 
Thank you for being quick to respond!
I'm trying to make it so the user can add fields and then choose a combobox with the fields as values, and then choose a separate combobox that shows the values under each field. I have attached a sample of what I want.
There is probably an easier way to handle this though, do you have any suggestions? I guess I just want to be able to add categories and then sub-categories and have them populate a form that is related to a different table :banghead:
 

Attachments

I could just make a table with fields labeled "Categories" and "Sub-Categories" and then run queries like the example you showed me.
 
This doesn't sound right to me. IMHO users should not need to add fields.
I would be happy to view you db but it would need to be posted in A2003 mdb format.
 
This doesn't sound right to me. IMHO users should not need to add fields.
I would be happy to view you db but it would need to be posted in A2003 mdb format.

I think you are right. Users shouldn't need to add fields. I'm just going to do what the link you provided me with does. Thank you for the help! :)
 

Users who are viewing this thread

Back
Top Bottom