Append query error message (1 Viewer)

David b

Registered User.
Local time
Today, 07:15
Joined
Mar 2, 2003
Messages
102
I have a form with 2 listboxes side by side. By double clicking a record in the
first lb that record appears in the 2nd lb by way of a table. The record id
field in the table is set to no duplicates to prevent the same record being sent
twice.
If a duplicate is selected the access error box "Can not append all records in
append query etc etc" tend s to confuse users.

How to I trap this error and put up a message box which the user can understand
?
TIA
David B
 

yippie_ky_yay

Registered User.
Local time
Today, 02:15
Joined
Jul 30, 2002
Messages
338
Hey David,

you could trap the error by getting the error number - but I have heard that this isn't recommended as those numbers might change in future versions.

What I would do is make your first listbox based on a query rather than just on the table. The query would select all records from your table as it is now, but add the criteria where primary id is not in your second list box.

-Sean
 

David b

Registered User.
Local time
Today, 07:15
Joined
Mar 2, 2003
Messages
102
Got it now. Thanks for your help
DB
 

Users who are viewing this thread

Top Bottom