Forum home » Delegate support and help forum » Microsoft Access Training and help » Make table queries
Make table queries
Resolved · Low Priority · Version 2003
Make table queries
If I made a make table query and a form to run that query, and I wanted to run that query several times a year but I didnt want to re-write existing tables, how would I do that?For upcoming training course dates see: Pricing & availability
RE: Make table queries
Thank you for your questionAfter some consideration it seems the only way to do this would be to write some VBA code that would prompt the user to enter a table name and would then insert that name into the queries SQL and then run the query.
An example of the code required is as follows
Sub MakeTable()
Dim strTable As String
Dim strSQL As String
strTable = InputBox("Enter table name")
strSQL = "SELECT Employees.Company, Employees.[Last Name], Employees.[First Name] INTO" & """strtable""" & "FROM Employees;"
DoCmd.Run strSQL
End SubHowever I suggest that you might find things easier if you use an append query to send all the data to the same table. You can then run searches on that table using date ranges
Regards
Stephen
|
|
» Forum post: Tables in Excel |



Course updates

