Navyguy
Registered User.
- Local time
- Today, 17:42
- Joined
- Jan 21, 2004
- Messages
- 194
What I have is a form that I use as a filter to select a record for updating. It is called Frm-Resident Select Incident and the field I enter the criteria is called Incident Report Number.
I then click on a button the opens another form called Frm-Resident Incident Data based on a query that is filtered on the form Frm-Resident Select Incident.
If I enter a number of a record that already exists there is not problem, but if I enter anything else I always get a blank record. What I would like is a MsgBox to come up and say something to the effect that “there is no such record, try again”.
Here is the code that I have tried, but just getting an error saying that the field “|” cannot be found. Please tell me if I am using the right code or even if I am using it in the right place.
If IsNull([Frm-Resident Incident Data]![Incident Report Number]) Or ([Frm-Resident Incident Data]![Incident Report Number]) = "" Then
MsgBox "There Is No Incident Recorded By That Number", vbOKOnly, "Invalid Search Criterion!"
[Frm-Resident Select Incident]![Incident Report Number].SetFocus
As always, thanks for your help
Navyguy
I then click on a button the opens another form called Frm-Resident Incident Data based on a query that is filtered on the form Frm-Resident Select Incident.
If I enter a number of a record that already exists there is not problem, but if I enter anything else I always get a blank record. What I would like is a MsgBox to come up and say something to the effect that “there is no such record, try again”.
Here is the code that I have tried, but just getting an error saying that the field “|” cannot be found. Please tell me if I am using the right code or even if I am using it in the right place.
If IsNull([Frm-Resident Incident Data]![Incident Report Number]) Or ([Frm-Resident Incident Data]![Incident Report Number]) = "" Then
MsgBox "There Is No Incident Recorded By That Number", vbOKOnly, "Invalid Search Criterion!"
[Frm-Resident Select Incident]![Incident Report Number].SetFocus
As always, thanks for your help
Navyguy