T
toddjmaxwell
This hangs on the DoCmd.GoToControl "MODEL" with MODEL being the field
in the query. Query name PARTSEARCH and the form page is named
PARTSSEARCH (extra S in the form page name)
The errors is, There is no field named "MODEL" in current record
Private Sub cmdsearch_Click()
Dim strPARTSEARCHRef As String
Dim strSearch As String
If IsNull(Me![txtSearch]) Or (Me![txtSearch]) = "" Then
MsgBox "Please enter Part Number!", vbOKOnly, "Invalid Search
Criteria!"
Me![txtSearch].SetFocus
Exit Sub
End If
DoCmd.ShowAllRecords
DoCmd.GoToControl "[MODEL]"
DoCmd.FindRecord Me![txtSearch]
strpartSearch.SetFocus
strPARTSEARCHRef = strMODEL.Text
txtSearch.SetFocus
strSearch = txtSearch.Text
If strSEARCHRef = strSearch Then
MsgBox "Match Found For: " & strSearch, , "Congratulations!"
strMODEL.SetFocus
txtSearch = ""
Else
MsgBox "Match Not Found For: " & strSearch & " - Please Try Again.", _
, "Invalid Search Criterion!"
txtSearch.SetFocus
End If
End Sub
in the query. Query name PARTSEARCH and the form page is named
PARTSSEARCH (extra S in the form page name)
The errors is, There is no field named "MODEL" in current record
Private Sub cmdsearch_Click()
Dim strPARTSEARCHRef As String
Dim strSearch As String
If IsNull(Me![txtSearch]) Or (Me![txtSearch]) = "" Then
MsgBox "Please enter Part Number!", vbOKOnly, "Invalid Search
Criteria!"
Me![txtSearch].SetFocus
Exit Sub
End If
DoCmd.ShowAllRecords
DoCmd.GoToControl "[MODEL]"
DoCmd.FindRecord Me![txtSearch]
strpartSearch.SetFocus
strPARTSEARCHRef = strMODEL.Text
txtSearch.SetFocus
strSearch = txtSearch.Text
If strSEARCHRef = strSearch Then
MsgBox "Match Found For: " & strSearch, , "Congratulations!"
strMODEL.SetFocus
txtSearch = ""
Else
MsgBox "Match Not Found For: " & strSearch & " - Please Try Again.", _
, "Invalid Search Criterion!"
txtSearch.SetFocus
End If
End Sub