Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

Using ADODB, how do I create a msgbox when duplicate data is enter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chrism - 29 May 2007 18:21 GMT
Hello,

I am having a problem creating a msgbox, when data entered through a form
into a table is duplicated.  I would like for a msgbox to popup, and warn the
user for dupliucate data, before the actual data is entered into the table.  
I have an index for no duplicate set on a field in a table.  How would I go
about this?  I have seen code for Jet, and have tried to translate it over to
ADODB, but with many problems.  Any help with this will be greatly
appreciated.

Thanks
Maurice - 29 May 2007 19:30 GMT
I don't know the code which is causing the problems with Jet but have you
tried working with the 'match' something like:

before_update from the form

open the recordset and look for a match if there is a match raise the
messagebox and exit the sub so the user can make the changes and otherwise
resume with the record append to the table.

Signature

Maurice Ausum

> Hello,
>
[quoted text clipped - 7 lines]
>
> Thanks
Chrism - 29 May 2007 21:22 GMT
How would I go about doing this?  I try to "match" what is already in the
recordset, and I get Runtime Errors with Access.   I just need to match 1 set
of data, out of 6 that is getting entered.

> I don't know the code which is causing the problems with Jet but have you
> tried working with the 'match' something like:
[quoted text clipped - 16 lines]
> >
> > Thanks
NetworkTrade - 29 May 2007 22:35 GMT
here is advice from Steve Schapel that helped on a similar requirement:
------------------------------------------------------------------------------------------
Make a macro with the MsgBox action, and enter an appropriate message to
display.  In the Condition (if you can't see a Condition column in the macro
design window, select it from the View menu), put the equivalent of this...
 DCount("*","YourTable","[FieldName]='" & [TextBoxName] & "'")>0

Assign this macro on the Before Update event of your form, .
Signature

Steve Schapel, Microsoft Access MVP

--
NTC

> How would I go about doing this?  I try to "match" what is already in the
> recordset, and I get Runtime Errors with Access.   I just need to match 1 set
[quoted text clipped - 20 lines]
> > >
> > > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.