Require Entry Label To Have Date & Time

uneek78

Registered User.
Local time
Yesterday, 19:14
Joined
Mar 26, 2009
Messages
68
Not sure whether to put this under tables or forms...

I have a form that users are required to enter the date & time in the same column. If the users only enter time the database accepts that. I want the database to restrict them from not entering both date & time. These entries subtract date/time from each other and give days/hours/minutes. So I need something that can do this without changing that aspect. I have attached a picture.

P.S.- If they would just remember to do it correctly I wouldn't have to go through this. They're driving me crazy!!! :eek:
 

Attachments

  • date&time.JPG
    date&time.JPG
    16.5 KB · Views: 127
What do you want?

Date and time?
Date only?
Time only?

Look at using input masks
 
I want them to be required to enter both the date & time. Because they often forget to enter the date and the database will simply accept just time if that's what you put there.
 
Then set up an input mask. such as

99/99/0000 00:00;0;_

This will force then to input a date and time. However they may need to use a 24hr clock.
 
I did this in those specific columns and also changed the "required" option to "yes", but it still takes just allows me to just enter time. I did this on the table.
 
Okay, once I put 99/99/00\ 09:00\ >LL;0; into the input mask for the form it works perfectly. It even prompts for am/pm. If you try to deviate from entering the time or date you get a message stating something wasn't entered correctly. Is there a way to edit that message the user gets? The message is too techie and I'm sure it will confuse my users if I can't change it to something a little less technical.
 
I don't rhink that you can change the system message, but others might know differently.
What I would say from 40+ years in IT is that users will be as dumb as we allow them to be, but not half as dumb as we think they are. They will soon understand that the message means they have entered the data incorrectly.

Brian
 
I don't rhink that you can change the system message, but others might know differently.
What I would say from 40+ years in IT is that users will be as dumb as we allow them to be, but not half as dumb as we think they are. They will soon understand that the message means they have entered the data incorrectly.

Brian

We have a lot of dumb students here also :D
 
You can trap the error message on the Form's On Error event. Something like this:

Code:
Private Sub Form_Error(DataErr As Integer, response As Integer)
    Const INPUTMASK_VIOLATION = 2113
    If DataErr = INPUTMASK_VIOLATION Then
       MsgBox "There was an input mask violation!"
       response = acDataErrContinue
    End If
End Sub
I'm not entirely sure if 2113 is the input mask err number, but I have a gutt feeling it is. Try it out.
 

Users who are viewing this thread

Back
Top Bottom