Hi I have a problem and I just can't figure it out.
I have a pop up form that has a query in it that is filtered by what ever you enter in the txt box. The user then clicks on a record which first sends the data to a txt box (this part works) then I run Forms![Price List Matts Admin].btn_searchOrderCode_Click to click a button on the main form that has other code behind it that does its stuff, the subform then closes.
The problem is that running Forms![Price List Matts Admin].btn_searchOrderCode_Click keeps getting me this error:
Run-time error '2465':
Application-defined or object-defined error
I can't figure it out because I have the same code doing the same thing on another form working fine. This is an old system that I occasionally do work on.
Here is all the code that runs when you click on a record selector:
Private Sub Form_Click()
'This moves a order code to a txt box then clicks the button btn_searchOrderCode using vba.
'The button has code behind it that then runs.
'the sub form is then closed
Forms![Price List Matts Admin]!txt_search = Me.txt_OrderCode
Forms![Price List Matts Admin].btn_searchOrderCode_Click
DoCmd.Close acForm, "search_matts"
End Sub
If anyone has any ideas I would love to hear them.
Thanks.
I have a pop up form that has a query in it that is filtered by what ever you enter in the txt box. The user then clicks on a record which first sends the data to a txt box (this part works) then I run Forms![Price List Matts Admin].btn_searchOrderCode_Click to click a button on the main form that has other code behind it that does its stuff, the subform then closes.
The problem is that running Forms![Price List Matts Admin].btn_searchOrderCode_Click keeps getting me this error:
Run-time error '2465':
Application-defined or object-defined error
I can't figure it out because I have the same code doing the same thing on another form working fine. This is an old system that I occasionally do work on.
Here is all the code that runs when you click on a record selector:
Private Sub Form_Click()
'This moves a order code to a txt box then clicks the button btn_searchOrderCode using vba.
'The button has code behind it that then runs.
'the sub form is then closed
Forms![Price List Matts Admin]!txt_search = Me.txt_OrderCode
Forms![Price List Matts Admin].btn_searchOrderCode_Click
DoCmd.Close acForm, "search_matts"
End Sub
If anyone has any ideas I would love to hear them.
Thanks.