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 / January 2005

Tip: Looking for answers? Try searching our database.

no duplicate records if

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
edo - 21 Jan 2005 10:19 GMT
I have an error-DB for machines. I don’t want users to insert duplicates if
the error isn’t solved. Therefor the code has to look in the field ‘Datum
gereed’ (a date field). If the error is solved there will be a date in this
field.

Who can help me to rebuild the code?

Private Sub Objectnr_BeforeUpdate(Cancel As Integer)
   If (Not IsNull(DLookup("[Objectnr]", _
       "Storingen", "[Objectnr] ='" _
       & Me!Objectnr & "'"))) Then
       MsgBox "Storing is reeds ingevoerd, controleer de status."
       Cancel = True
       Me!Objectnr.Undo
   End If
End Sub
Rob Oldfield - 22 Jan 2005 10:01 GMT
I don't get exactly what you mean.  The code you've supplied is the same
thing, but for a text field, and you just need to know how to make it work
for a date?  If that is the case then you'll just need to do much the same
thing, but with the # character instead of the '.  Something like..

If (Not IsNull(DLookup("[PKField]", _
"Storingen", "[Datum gereed] =#" _
& Me![Datum gereed] & "#"))) Then

Without sitting down and trying it, I can't remember if you might need a
cstr function in there to turn Me![Datum gereed] into text.

> I have an error-DB for machines. I don't want users to insert duplicates
if
> the error isn't solved. Therefor the code has to look in the field 'Datum
> gereed' (a date field). If the error is solved there will be a date in
this
> field.
>
[quoted text clipped - 9 lines]
>     End If
> End Sub
 
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.