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 / February 2008

Tip: Looking for answers? Try searching our database.

Form Field -  No Duplicate

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Torres - 14 Feb 2008 21:07 GMT
Is there any way that a field in access form tells you immediately once a
record is duplicated? I went to Table and indexed it to "No Duplicates" but
it appears that a dialogue box appears after the whole entry form is filled
and then the warning sign.
Thanks,
John
Al Campagna - 15 Feb 2008 01:01 GMT
John,
  Do a Refresh on the AfterUpdate of the field involved.
Signature

   hth
   Al Campagna
   Microsoft Access MVP
   http://home.comcast.net/~cccsolutions/index.html

   "Find a job that you love... and you'll never work a day in your life."

> Is there any way that a field in access form tells you immediately once a
> record is duplicated? I went to Table and indexed it to "No Duplicates"
> but it appears that a dialogue box appears after the whole entry form is
> filled and then the warning sign.
> Thanks,
> John
John Torres - 15 Feb 2008 13:56 GMT
Hi Al,
How do i do that? Is that a code that needs to be written? I tried typing
refresh and it was looking for macros.
Thanks again.
John

> John,
>   Do a Refresh on the AfterUpdate of the field involved.
[quoted text clipped - 4 lines]
>> Thanks,
>> John
Al Campagna - 15 Feb 2008 18:23 GMT
John,
   In Form Design mode, select the field you want to monitor for dupes (ex.
MyField).
   In the properties box for that field, find the AfterUpdate event.
   Enter "Event Procedure" in the AfterUpdate text field. (no quotes)
       (OR... Using the down arrow to the right of the textbox, select
[EventProcedure])
   Click the  little three dot button that appears on the right of the
AfterUpdate text box. (...)
   You are now in the form's module, and you should see...

Private Sub MyField_AfterUpdate()

End Sub

Add your Refresh...

Private Sub MyField_AfterUpdate()
   Refresh
End Sub

Now, each time MyField's value changes, if it violates the NoDuplicates
rule, it should bark that right away.
Signature

   hth
   Al Campagna
   Microsoft Access MVP
   http://home.comcast.net/~cccsolutions/index.html

   "Find a job that you love... and you'll never work a day in your life."

> Hi Al,
> How do i do that? Is that a code that needs to be written? I tried typing
[quoted text clipped - 10 lines]
>>> Thanks,
>>> John
 
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.