update issue with SQL

S

smk23

I have the following query:

SELECT a.PatientPhoneID, a.PatientID, a.PhoneID, ph.PhoneID AS PhPhoneID,
ph.PhoneTypeID, ph.PhoneNumber, ph.Extension
FROM Phone AS ph INNER JOIN PatientPhone ON a ph.PhoneID = a.PhoneID;

a.PatientPhoneID is the PK of the PatientPhone table and is autonumber.

ph.PhoneID is the PK of the Phone table and is autonumber.

tables are SQL 2000

This query works 90% of the time, but occasionally will throw an error "the
microsoft jet database cannot find a record in "phone" with key matching
field "PhoneID"

When this error occurs, no further phone numbers can be entered. THe user
has to close the form and reopen. When it reopens, it works fine again for
awhile, and after perhaps 50 phone numbers, starts throwing the error again
and have to close and reopen again.

I've tried everything I can think of, i.e. requering after every entry,
programmatically putting PatientID and phoneID in the PatientPhone table,etc.
Nothing seems to help.
Any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top