Re: Duplicate Record Warnings

From: Michel Walsh (vanderghast_at_VirusAreFunnierThanSpam)
Date: 11/05/04


Date: Fri, 5 Nov 2004 08:06:10 -0500

Hi,

Should be

Dcount("*","tblFINSPECTcustspec", "ITEM=""" & Me.ITEM & """" )

be sure to add a space after Item and before &.

At then end of the table name, use " not : (an original typo in my
reply).

Hoping it may help,
Vanderghast, Access MVP

"RAO" <RAO@discussions.microsoft.com> wrote in message
news:3E902AFD-1890-449A-BBF4-D93348942881@microsoft.com...
> Hello,
> I have tried the code from Michel and got an error message: Expected list
> separator or ).
> If 0 <> Dcount("*","tblFINSPECTcustspec:,ITEM=""& Me.ITEM&"""")
> Any ideas what I have wrong?
> Thanks,
>
>
> "Dustin Ventin" wrote:
>
>> I have a field in my Access database that I do not want duplicated, so I
>> set
>> it in the table properties not to allow duplicates. It works great for
>> not
>> allowing duplicate records.
>>
>> The problem is that the form people access this table through does not
>> warn
>> them when they have duplicated the project number. It is a
>> additions-only
>> form designed for the entry of a single record of entry, and then the
>> user
>> presses 'done'. If the field in question is a duplicate, the form just
>> closes like normal, but doesn't insert the record. No warning, no
>> nothing.
>> It's as if the OnError event isn't firing.
>>
>> I have been using the docmd.setwarnings(false) command in VBA in certain
>> places, but I put docmd.setwarnings(true) directly above the exit
>> command,
>> and still no warning. Why are no warning messages showing up?
>>
>> Any ideas?
>>
>> Dustin Ventin



Relevant Pages

  • RE: Duplicate Record Warnings
    ... I have tried the code from Michel and got an error message: ... If the field in question is a duplicate, ... No warning, no nothing. ... > places, but I put docmd.setwarningsdirectly above the exit command, ...
    (microsoft.public.access.forms)
  • Re: OE6 shuts down after find function results
    ... Arthur: I don't really have any idea since I've never seen or heard of any ... duplicate it despite trying several times on different machines using a ... Your reply suggests you are getting some type of error message and if you ... > reinstall of OE6 using method 2 from the Knowledge Base ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Clearing a duplicate record
    ... Your code is working great for the "Duplicate" message and OK and Cancel, ... I'm still getting the Microsoft Access Error message box "Violation ... >> Set rst = db.OpenRecordset ...
    (microsoft.public.access.formscoding)
  • Re: Duplicate the record in form and subform
    ... Have changed the code as below but got an error message "Error#3061, ... Dim strSql As String 'SQL statement. ... Dim lngID As String 'Primary key value of the new record. ... 'Make sure there is a record to duplicate. ...
    (microsoft.public.access.formscoding)
  • Re: A disturbing message...
    ... It looks that someone on your network has same computer name as yours ... "Duplicate Name Exists" Error Message When You Start a Windows XP ... > There are only two user accounts, both of different names, and the guest ...
    (microsoft.public.windowsxp.basics)