Not very good at delimiters, operators etc

Ok I've viewed it in the immediate window thanks, it still appears to be fine??

attachment.php
 

Attachments

  • Capture.jpg
    Capture.jpg
    95.5 KB · Views: 98
Well, it all looks right to me. I can't see anything out of the ordinary. The last thing I would try is changing to this:

If DCount("*", "tblCustomerComments", "[CommentAlarm]= #" & Format(Me.txtCommentAlarm, "mm\/dd\/yyyy) & "#") > 0 Then

and if that doesn't work then perhaps if you post a copy of your database (with bogus data of course) maybe David, since he has the same regional settings, could try it out and see if he can spot what is wrong.
 
Ok thankyou Bob, I really appreciate your help! I will try this in the morning and post back :)
 
Well, it all looks right to me. I can't see anything out of the ordinary. The last thing I would try is changing to this:

If DCount("*", "tblCustomerComments", "[CommentAlarm]= #" & Format(Me.txtCommentAlarm, "mm\/dd\/yyyy) & "#") > 0 Then

and if that doesn't work then perhaps if you post a copy of your database (with bogus data of course) maybe David, since he has the same regional settings, could try it out and see if he can spot what is wrong.

Sorry I get syntax error again on this, in the code not the form :rolleyes:

Edit - its ok it was missing a "

Code:
If DCount("*", "tblCustomerComments", "[CommentAlarm]= #" & Format(Me.txtCommentAlarm, "mm\/dd\/yyyy[B][COLOR=red]"[/COLOR][/B]) & "#") > 0 Then

And it works now!!! Thankyou very much! :D
 
Oh...... except it doesn't prevent me from entering duplicate alarm dates :( :confused:
 
But you are counting dates with times not just dates only
 
Sorry David. It doesn't prevent me from entering duplicate date/times. I want to prevent two alarms trying to pop up in the same minute etc, so prevent duplicate date/time down to the minute from being entered. Do I have to add hh:nn to the code?

Yes that worked! Woohoo...I'm learning! :D

Code:
If DCount("*", "tblCustomerComments", "[CommentAlarm]= #" & Format(Me![txtCommentAlarm], "mm\/dd\/yyyy hh:nn") & "#") > 0 Then
 

Users who are viewing this thread

Back
Top Bottom