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 / Forms Programming / May 2007

Tip: Looking for answers? Try searching our database.

Error if the number is repeated

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
acores - 06 May 2007 11:47 GMT
Hello.
I have a table «Clients». In that table, among others, I have a field
«Chosen number». The client can chose this number. However this number cannot
be repeated.
In the table «Clients», the field «Chosen number» is set to be indexed (no
duplicates), but when I enter a repeated value, nothing happens... the table
doesn't assume the repeated value and that 's all.
What I wanted to do is that when a client chose a already chosen number by
another client, appears a message box saying «Number already chosen. Please
try another one.», and the client could try to enter a new value.
Is it possible to do this?
Thanks in advance.
Best regards.
Allen Browne - 06 May 2007 12:40 GMT
Use DLookup() in the AfterUpdate event procedure of the control on the form
where the user enters the Chosen Number.

If it already exists, show a MsgBox.

For details on how to use DLookup(), see:
   Getting a value from a table: DLookup()
at:
   http://allenbrowne.com/casu-07.html

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Hello.
> I have a table «Clients». In that table, among others, I have a field
[quoted text clipped - 12 lines]
> Thanks in advance.
> Best regards.
acores - 06 May 2007 16:55 GMT
Thank you, Allen. It worked fine.

> Use DLookup() in the AfterUpdate event procedure of the control on the form
> where the user enters the Chosen Number.
[quoted text clipped - 22 lines]
> > Thanks in advance.
> > Best regards.
 
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.