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

HOW TO CHOOSE A TABLE WITH VBA

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Does anyone know how to select a table based on a string. i nned to choose the table based on the combobox selection.


thanks
 
Can you explain what you are trying to do a little more? I'm not following the question, examples are helpful! Joe Miller
joe.miller@flotech.net
 
i am trying to use a combo box to choose a table. i have 4 combo boxs which select criteria and need to create a sql string that will translate into sql such as:

strsql ="select s_account,s_mtdact,S_mtdbud from s_month;"


s_month can be any of 12 tables for each month. when a person picks the month from the drop down, i need it to refer to the table i need to query on.

thanks


mark

 
Something like this perhaps?

strSQL = strsql ="select s_account,s_mtdact,S_mtdbud from " & MonthComboName &";"

HTH Joe Miller
joe.miller@flotech.net
 
Let's try that again:

strSQL = "select s_account,s_mtdact,S_mtdbud from " & MonthComboName &";"
Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top