Hi all,
Got a question on a search criteria. On the mainform, i have a search button which brings up a Search form. Now what I want to do is have the user put their value in and then when they click on the Search button on the Search form to automatically move and affect the Mainform. I'm having problems with the code because it keeps asking for an object. Now here is the code in the Search form:
Private Sub cmdSearch_Click()
On Error GoTo Err_cmdSearch_Click
If txtContract Is Null Or txtContract = Empty Then
strmessage = MsgBox("You must enter a Contract Number to search with.", vbOKOnly)
Else
Form_DOECIT![Contract Num].SetFocus
DoCmd.FindRecord txtContract
End If
Exit_cmdSearch_Click:
Exit Sub
Err_cmdSearch_Click:
MsgBox Err.Description
Resume Exit_cmdSearch_Click
End Sub
Help is great. Thanks!
Got a question on a search criteria. On the mainform, i have a search button which brings up a Search form. Now what I want to do is have the user put their value in and then when they click on the Search button on the Search form to automatically move and affect the Mainform. I'm having problems with the code because it keeps asking for an object. Now here is the code in the Search form:
Private Sub cmdSearch_Click()
On Error GoTo Err_cmdSearch_Click
If txtContract Is Null Or txtContract = Empty Then
strmessage = MsgBox("You must enter a Contract Number to search with.", vbOKOnly)
Else
Form_DOECIT![Contract Num].SetFocus
DoCmd.FindRecord txtContract
End If
Exit_cmdSearch_Click:
Exit Sub
Err_cmdSearch_Click:
MsgBox Err.Description
Resume Exit_cmdSearch_Click
End Sub
Help is great. Thanks!