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 querries 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 querries?
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 querries 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 querries?
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