Hello,
I have a form that requires user input. The user inputs a check number in an unbound text box and then the form pulls the data for that check number based off of Table 2. If the check number is not in Table 2, a message is displayed that the record can not be found. Here is the code. Keep in mind I know little about code and stole this from someone else, but it works great.
Private Sub Enter_Check_Number_AfterUpdate()
If (Enter_Check_Number & vbNullString) = vbNullString Then Exit Sub
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "[Check Number]=""" & Enter_Check_Number & """"
If rs.NoMatch Then
MsgBox "Sorry, no such record was found.", _
vbOKOnly + vbInformation
Else
Me.Recordset.Bookmark = rs.Bookmark
End If
rs.Close
txtGoTo = Null
End Sub
What I need the form to do now is if the check number entered by the user can not be found in Table 2, to look at Table 3 and then Table 4 to find it. If it is not in Table 2, 3, or 4 it's okay to display the message that the record can't be found. There is no relationship between the three tables, but they all have exactly the same fields. Each record will be in one of the three tables only one time.
Thanks.