ccondran08
Registered User.
- Local time
- Tomorrow, 06:50
- Joined
- Feb 27, 2014
- Messages
- 58
Just wondering if this can be done, the below code doesn't work. I want to be able to change the order in which certain queries are run by placing the query names in a text box on the main menu so it can the user can modify the names of the queries dynamically. The example below has 2 text boxes on the main menu with the names of the queries in the text box.
Dim Query1 As String
Dim Query2 As String
Query1 = [Forms]![frm_Main_Menu].[txt_First_Query]
Query2 = [Forms]![frm_Main_Menu].[txt_Second_Query]
DoCmd.SetWarnings False
DoCmd.OpenQuery "Query1", acViewNormal, acAdd
Forms!frm_Main_Menu.Refresh
DoCmd.OpenQuery "Query2", acViewNormal, acAdd
Forms!frm_Main_Menu.Refresh
The attached image shows what I'm trying to do.
Dim Query1 As String
Dim Query2 As String
Query1 = [Forms]![frm_Main_Menu].[txt_First_Query]
Query2 = [Forms]![frm_Main_Menu].[txt_Second_Query]
DoCmd.SetWarnings False
DoCmd.OpenQuery "Query1", acViewNormal, acAdd
Forms!frm_Main_Menu.Refresh
DoCmd.OpenQuery "Query2", acViewNormal, acAdd
Forms!frm_Main_Menu.Refresh
The attached image shows what I'm trying to do.
Attachments
Last edited: