A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Message Box Assisstance



 
 
Thread Tools Display Modes
  #1  
Old February 9th, 2006, 10:10 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Message Box Assisstance

Hi,

I have a field DriverNo in a table called tblStaff.

I have made the property Indexed to be Yes (No Duplicates).

I would like a message to pop up if a user tries to enter a duplicate
DriverNo.

I've never used Message Boxes before.

Thanks

Greg.
  #2  
Old February 9th, 2006, 12:46 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Message Box Assisstance

"Greg" wrote in message
...
Hi,

I have a field DriverNo in a table called tblStaff.

I have made the property Indexed to be Yes (No Duplicates).

I would like a message to pop up if a user tries to enter a duplicate
DriverNo.

I've never used Message Boxes before.


You will get a run-time error message for free if a duplicate entry is
attempted.

Regards,
Keith.
www.keithwilby.com


  #3  
Old February 9th, 2006, 01:27 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Message Box Assisstance

Where (from a form, from a datasheet) and When (upon entry of the data for
Driver No, when the record is saved)?

Assumption:
Entry on a form into a control.

When exiting the control after updating it, you want a message warning the
user that this is a duplicate and cannot be saved.

Private Sub txtDriverNoControlName _AfterUpdate()
IF DCount("*","TblStaff","[Driver no]=" & Chr(34) &
me.txtDriverNoControlName & Chr(34)) 0 Then
MsgBox "This Driver Number is a duplicate. You may not be able to save
this record",,"Suspected Duplicate"
END IF
End Sub


If Driver No is a number field and not a text field then remove the Chr(34)
from the DCount.


"Greg" wrote in message
...
Hi,

I have a field DriverNo in a table called tblStaff.

I have made the property Indexed to be Yes (No Duplicates).

I would like a message to pop up if a user tries to enter a duplicate
DriverNo.

I've never used Message Boxes before.

Thanks

Greg.



 




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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing Outlook 2003 calendar Noel All Installation & Setup 11 August 22nd, 2005 05:26 PM
Outlook Express is slow ava cohen Outlook Express 18 August 27th, 2004 12:17 AM
error message - server rejecting recipient Ken Outlook Express 5 August 20th, 2004 06:39 PM
msimn.exe-Application error message Blondenblue_uk Outlook Express 2 July 23rd, 2004 01:03 PM
trying to gain access to emails on old hard disk wilfred Outlook Express 2 July 13th, 2004 11:35 AM


All times are GMT +1. The time now is 03:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.