G
Guest
I got the DoCmd.GoToControl to work, but it hangs on the DoCmd.FindRecord
Me!txtSearch. What am I doing wrong, I have tried to write this a number of
ways. PARTS is the name of the query.
Private Sub cmdsearch_Click()
Dim strPARTSRef As String
Dim strSearch As String
If IsNull(Me![txtSearch]) Or (Me![txtSearch]) = "" Then
MsgBox "Please enter a Part Number !", vbOKOnly, "Invalid Search
Criterion!"
Me![txtSearch].SetFocus
Exit Sub
End If
'---------------------------------------------------------------
DoCmd.ShowAllRecords
DoCmd.GoToControl ("MODEL")
DoCmd.FindRecord Me!txtSearch
strMODEL.SetFocus
strPARTSRef = strpartSearch.Text
txtSearch.SetFocus
strSearch = txtSearch.Text
If strPARTSRef = strSearch Then
MsgBox "Match Found For: " & strSearch, , "Congrats!"
strMODEL.SetFocus
txtSearch = ""
Else
MsgBox "Match Not Found For: " & strSearch & " - Re-Enter Part
Number.", _
, "Invalid Search Criterion!"
txtSearch.SetFocus
End If
End Sub
Me!txtSearch. What am I doing wrong, I have tried to write this a number of
ways. PARTS is the name of the query.
Private Sub cmdsearch_Click()
Dim strPARTSRef As String
Dim strSearch As String
If IsNull(Me![txtSearch]) Or (Me![txtSearch]) = "" Then
MsgBox "Please enter a Part Number !", vbOKOnly, "Invalid Search
Criterion!"
Me![txtSearch].SetFocus
Exit Sub
End If
'---------------------------------------------------------------
DoCmd.ShowAllRecords
DoCmd.GoToControl ("MODEL")
DoCmd.FindRecord Me!txtSearch
strMODEL.SetFocus
strPARTSRef = strpartSearch.Text
txtSearch.SetFocus
strSearch = txtSearch.Text
If strPARTSRef = strSearch Then
MsgBox "Match Found For: " & strSearch, , "Congrats!"
strMODEL.SetFocus
txtSearch = ""
Else
MsgBox "Match Not Found For: " & strSearch & " - Re-Enter Part
Number.", _
, "Invalid Search Criterion!"
txtSearch.SetFocus
End If
End Sub