Hi Bob,
The following lines of code already in the article warns the user that the
value already exists:
If Not IsNull(x) Then
Beep
MsgBox "That value already exists", vbOKOnly, "Duplicate Value"
Cancel = True
End If
I guess what you want to add is the following:
Dim Response As String
If Not IsNull(x) Then
Beep
Response = MsgBox "That value already exists. Continue?", vbYesNo,
"Duplicate Value"
If Response = vbYes Then
Cancel = True
Else
Cancel = False
End If
End If
Regards,
Eric Butts
Microsoft Access Support
(e-mail address removed)
"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<
http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <
http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."
This posting is provided "AS IS" with no warranties, and confers no rights
--------------------
| Content-Class: urn:content-classes:message
| From: "Bob" <
[email protected]>
| Sender: "Bob" <
[email protected]>
| References: <
[email protected]>
<8O#
[email protected]>
| Subject: RE: "On Enter" Property in a form
| Date: Fri, 12 Mar 2004 08:49:32 -0800hU
| Lines: 80
| Message-ID: <
[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcQIUf6TxVLFXbk0SaCuHEvDfQ+v4Q==
| Newsgroups: microsoft.public.access.tablesdbdesign
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.access.tablesdbdesign:77048
| NNTP-Posting-Host: tk2msftngxa12.phx.gbl 10.40.1.164
| X-Tomcat-NG: microsoft.public.access.tablesdbdesign
|
| Thanks, this worked great. However, is there a specific
| code that can be inserted within that existing code that
| would ask in a popup window to accept "Yes or No". I am
| not a programer, could you supply specifics?
| >-----Original Message-----
| >Hi Bob,
| >
| >Here's an article that should help:
| >
| >ACC2000: How to Use Visual Basic for Applications to
| Check for Duplicate
| >Values in a Field
| >
http://support.microsoft.com/default.aspx?scid=kb;en-
| us;209479
| >
| >I hope this helps! If you have additional questions on
| this topic, please
| >respond back to this posting.
| >
| >
| >Regards,
| >
| >Eric Butts
| >Microsoft Access Support
| >
[email protected]
| >"Microsoft Security Announcement: Have you installed the
| patch for
| >Microsoft Security Bulletin MS03-026? If not Microsoft
| strongly advises
| >you to review the information at the following link
| regarding Microsoft
| >Security Bulletin MS03-026
| ><
http://www.microsoft.com/security/security_bulletins/ms03
| -026.asp> and/or
| >to visit Windows Update at
| <
http://windowsupdate.microsoft.com/> to install
| >the patch. Running the SCAN program from the Windows
| Update site will help
| >to insure you are current with all security patches, not
| just MS03-026."
| >
| >This posting is provided "AS IS" with no warranties, and
| confers no rights
| >
| >--------------------
| >| Content-Class: urn:content-classes:message
| >| From: "Bob" <
[email protected]>
| >| Sender: "Bob" <
[email protected]>
| >| Subject: "On Enter" Property in a form
| >| Date: Wed, 10 Mar 2004 08:43:31 -0800
| >| Lines: 6
| >| Message-ID: <
[email protected]>
| >| MIME-Version: 1.0
| >| Content-Type: text/plain;
| >| charset="iso-8859-1"
| >| Content-Transfer-Encoding: 7bit
| >| X-Newsreader: Microsoft CDO for Windows 2000
| >| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| >| Thread-Index: AcQGvtKKt7sNY54iTmKrf9Q5GqS8Iw==
| >| Newsgroups: microsoft.public.access.tablesdbdesign
| >| Path: cpmsftngxa06.phx.gbl
| >| Xref: cpmsftngxa06.phx.gbl
| microsoft.public.access.tablesdbdesign:76919
| >| NNTP-Posting-Host: tk2msftngxa14.phx.gbl 10.40.1.166
| >| X-Tomcat-NG: microsoft.public.access.tablesdbdesign
| >|
| >| How can one use the "on enter" porperty in a form to
| check
| >| for duplicates in the database? What would the
| expression
| >| look like? Would the result be once you hit the enter
| key
| >| to forward to the next field, will the expression check
| >| the database at that time and give a result if there is
| a
| >| match?
| >|
| >
| >.
| >
|