kentwoodjean
Technical User
I am looking for some help on writing a code. I have a form that is made based on a membership query. Upon entering a contract number in the first field, all other fields pertenent to the customer will populate (addr, city, state etc will appear. To accomplish this I am using an 'unbound' text box with the following code:
Private Sub ContractNum_AfterUpdate()
Dim szSQL As String
szSQL = "select * from qryMembership where Contract_Num = """ & Trim(Me.ContractNum) & """;"
Me.RecordSource = szSQL
End Sub
What I would like to do is have some type of error message that will aappear saying "Record not Found. I am learning Visual Basic and really don't now how to do this. Any help is appreciated. I checked the posts and couldn't find one for Access. thanks.
Private Sub ContractNum_AfterUpdate()
Dim szSQL As String
szSQL = "select * from qryMembership where Contract_Num = """ & Trim(Me.ContractNum) & """;"
Me.RecordSource = szSQL
End Sub
What I would like to do is have some type of error message that will aappear saying "Record not Found. I am learning Visual Basic and really don't now how to do this. Any help is appreciated. I checked the posts and couldn't find one for Access. thanks.