I've got a combo box to select from and then it creates a stored procedure and tries to open it.
I get this error message when i select an item from the combo box: "microsoft access can't find the object 'zTest'. when i look at the queries it's not there until i hit F5 to refresh and it appears. is there any way for this to work with out having to manually refresh the queries?
Private Sub Combo7_AfterUpdate()
Dim splr As String
splr = Combo7.Text
Dim SPname As String
Dim SQLstr As String
SQLstr = "CREATE PROCEDURE zTest AS SELECT * FROM _[Namelist - Suppliers] WHERE [Supplier:] = '" & splr & "'"
SPname = "zTest"
Me.Refresh
Text5 = SQLstr
DoCmd.RunSQL SQLstr
DoCmd.OpenStoredProcedure "zTest", acViewNormal, acEdit
End Sub
I get this error message when i select an item from the combo box: "microsoft access can't find the object 'zTest'. when i look at the queries it's not there until i hit F5 to refresh and it appears. is there any way for this to work with out having to manually refresh the queries?
Private Sub Combo7_AfterUpdate()
Dim splr As String
splr = Combo7.Text
Dim SPname As String
Dim SQLstr As String
SQLstr = "CREATE PROCEDURE zTest AS SELECT * FROM _[Namelist - Suppliers] WHERE [Supplier:] = '" & splr & "'"
SPname = "zTest"
Me.Refresh
Text5 = SQLstr
DoCmd.RunSQL SQLstr
DoCmd.OpenStoredProcedure "zTest", acViewNormal, acEdit
End Sub