I have code that copies an existing query to a new query. When I created the base query 'ciscoquerystructure' I used an existing table '0901', but I need to have the "new" queries I create from this code select from a DIFFERENT table. (i.e. 0902, 0903, 0807, etc)
Look:
Dim TableName As String, stSQL As String, CiscoTableName As String, CiscoFileName As String, CiscoQueryName As String
Err.clear
TableName = InputBox("Enter a Table Name for Updating", "Input")
CiscoTableName = TableName & "C"
CiscoQueryName = TableName & "CQ"
' Create append query
DoCmd.SetWarnings False
DoCmd.CopyObject , CiscoQueryName, acQuery, "ciscoquerystructure"
Right here, how can I tell the new query to use the new table as the source for data? i.e. new query named '0903CQ' should select records from table named '0903C'.
DoCmd.SetWarnings True
' Append cisco data to monthly table
DoCmd.SetWarnings False
DoCmd.OpenQuery CiscoQueryName, acViewNormal, acAdd
DoCmd.SetWarnings True
Look:
Dim TableName As String, stSQL As String, CiscoTableName As String, CiscoFileName As String, CiscoQueryName As String
Err.clear
TableName = InputBox("Enter a Table Name for Updating", "Input")
CiscoTableName = TableName & "C"
CiscoQueryName = TableName & "CQ"
' Create append query
DoCmd.SetWarnings False
DoCmd.CopyObject , CiscoQueryName, acQuery, "ciscoquerystructure"
Right here, how can I tell the new query to use the new table as the source for data? i.e. new query named '0903CQ' should select records from table named '0903C'.
DoCmd.SetWarnings True
' Append cisco data to monthly table
DoCmd.SetWarnings False
DoCmd.OpenQuery CiscoQueryName, acViewNormal, acAdd
DoCmd.SetWarnings True