dbTalk Databases Forums  

Duplicate error message

comp.databases.ms-access comp.databases.ms-access


Discuss Duplicate error message in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David B
 
Posts: n/a

Default Duplicate error message - 07-27-2003 , 01:59 PM






I have a form with a list box. Double clicking a record sends that recordno to
a table. I have the table set to no duplicates to prevent the same record
being sent twice. If a duplicate is sent the confusing (for the user) standard
access message appears - Access can`t append all records in the append query
etc etc.

How do I make a clearer error message for this situation ?
TIA
David b


Reply With Quote
  #2  
Old   
Patrick Finucane
 
Posts: n/a

Default Re: Duplicate error message - 07-27-2003 , 03:05 PM








David B wrote:
Quote:
I have a form with a list box. Double clicking a record sends that recordno to
a table. I have the table set to no duplicates to prevent the same record
being sent twice. If a duplicate is sent the confusing (for the user) standard
access message appears - Access can`t append all records in the append query
etc etc.

How do I make a clearer error message for this situation ?
TIA
David b
Why don't you check for the existence of the record in the dblClick
event before appending it?

Look at the OnError event for the form to present your own message if
you can't trap it with an error event handler from the OnDoubleClick
event of the listbox.


Reply With Quote
  #3  
Old   
David B
 
Posts: n/a

Default Re: Duplicate error message - 07-28-2003 , 11:46 PM




Patrick Finucane <finucanp (AT) mindspring (DOT) com> wrote

Quote:

David B wrote:

I have a form with a list box. Double clicking a record sends that recordno
to
a table. I have the table set to no duplicates to prevent the same record
being sent twice. If a duplicate is sent the confusing (for the user)
standard
access message appears - Access can`t append all records in the append
query
etc etc.

How do I make a clearer error message for this situation ?
TIA
David b

Why don't you check for the existence of the record in the dblClick
event before appending it?

Look at the OnError event for the form to present your own message if
you can't trap it with an error event handler from the OnDoubleClick
event of the listbox.
What is the best way of comparing what has been double clicked with what is
already in the table ?
David B



Reply With Quote
  #4  
Old   
Patrick Finucane
 
Posts: n/a

Default Re: Duplicate error message - 07-29-2003 , 02:34 AM





David B wrote:
Quote:
Patrick Finucane <finucanp (AT) mindspring (DOT) com> wrote in message
news:3F243084.D5AC0BD6 (AT) mindspring (DOT) com...


David B wrote:

I have a form with a list box. Double clicking a record sends that recordno
to
a table. I have the table set to no duplicates to prevent the same record
being sent twice. If a duplicate is sent the confusing (for the user)
standard
access message appears - Access can`t append all records in the append
query
etc etc.

How do I make a clearer error message for this situation ?
TIA
David b

Why don't you check for the existence of the record in the dblClick
event before appending it?

Look at the OnError event for the form to present your own message if
you can't trap it with an error event handler from the OnDoubleClick
event of the listbox.

What is the best way of comparing what has been double clicked with what is
already in the table ?
David B
I would take the value of the listbox. For ex, if the first column
(hidden) is the key, store it to a variable. Then either open up a
recordset and look for the key or whatever column data exists or create
a Query and open that up as a recordset and see if there are any records
(recordcount > 0) or something like that.

Look at OpenRecordset, RecordCount, FindFirst (and expecially the code
examples) for more information.

If you aren't a programmer, then I would check out Dlookup and DCount in
help and any examples of code.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.