I have a Make Table query that I am trying to run. It works fine when I define the table. Here is my code:
DoCmd.SetWarnings False
DoCmd.RunSQL ("SELECT tcID INTO tbl_cust FROM 1_tbltcMaster WHERE PrintRpt = True"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
DoCmd.SetWarnings True
But, what I really need is the ability to define what table the data is inserted in to (INTO portion of code). Ideally, when the user clicks 'Save', a pop-up form prompts them for the table. They select it from a drop-down box and the Make Table query is performed using the specified table.
I have tried defining the table as a string and having the string be in the code (INTO strTable FROM...) but it doesn't seem to work...
Any ideas would be greatly appreciated.
DoCmd.SetWarnings False
DoCmd.RunSQL ("SELECT tcID INTO tbl_cust FROM 1_tbltcMaster WHERE PrintRpt = True"
DoCmd.SetWarnings True
But, what I really need is the ability to define what table the data is inserted in to (INTO portion of code). Ideally, when the user clicks 'Save', a pop-up form prompts them for the table. They select it from a drop-down box and the Make Table query is performed using the specified table.
I have tried defining the table as a string and having the string be in the code (INTO strTable FROM...) but it doesn't seem to work...
Any ideas would be greatly appreciated.