No matching record from table on a form

vad60

VAD60
Local time
Today, 05:17
Joined
Jul 26, 2005
Messages
28
First I like to say this forum has always been helpful with my db issues. So thanks to all the experts.
This is a problem that I have been avoiding for a few years and need to get it corrected. My database is a Help Desk program used for post cut support of large PBX systems. I have two main tables, Keysheets and HelpDesk. My help desk form is built on a query with these two tables where the link fields, StationNo, must match. This is so when a trouble ticket is generated it brings up all station information. My problem comes in when the station number is not in my Keysheet table. The call taker enters the call information then gets an error because the station is not in the table. They then enter the information under a dummy station, 99999.
What I would like to do is to have access check the station number entered and if doesn't find a match in the Keysheet table to bring up an information box stating that it is not in the database. When they click OK then a new form will pop up to enter the new station info then when finished go back to the helpdesk form and complete the ticket entry. This issue is my biggest thorn with my database.
Thanks in advance for your help.
 
The form control for the STNO field. The STNO field on my form belongs to the HelpDesk table. This is where I record the issue being taken. The problem is when a stno number is not in my Keysheet table. I think I need to put some kind of code in the before update or lost focus of the STNO field to make the check in the Keysheet table for a mtach then pop up a data entry form.
 
To check if any records were returned you can use:

Code:
    If Me.Recordset.RecordCount < 1 Then
        MsgBox "No Records Found", vbOKOnly
        "Then set things back the way they were"
    End If
 

Users who are viewing this thread

Back
Top Bottom