944,103 Members | Top Members by Rank

Ad:
Jan 20th, 2007
0

Microsoft Access 2003 Validation Rule

Expand Post »
Hello,

I'm a novice at microsoft access and I'm trying to make a validation rule to limit what can be entered in a field for hours worked. I set the field size to decimal. I set it up to have 2 digits to the right and left of the decimal point. An axample is for an 8 hour day you would have to enter 08.00. I set it up to limit it to 24 hours by putting <24 in the validation rule box, too. The real problem is I need for the time to be entered in 1/4 hour increments, such as, 6.00, 5.25, 8.50 or 7.75. I've tried a few different ways but nothing is working. I could please use anybodies help with this.

Thanks,

Dan
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dstat is offline Offline
5 posts
since Jan 2007
Jan 22nd, 2007
0

Re: Microsoft Access 2003 Validation Rule

There is something fundamentally incorrect with what you are doing.

I am guessing that you used "Decimal Places" to set the digits right of the decimal separator. That won't work because the setting is only for what data needs to be displayed. You need to set the "Scale" for the number of digits to be stored to the right of the decimal separator. You would also need to set the "Precision" to 4 to have two digits on the left and two on the right.

I tried it this way and it works for me.
Reputation Points: 48
Solved Threads: 7
Posting Whiz
aniseed is offline Offline
353 posts
since Apr 2006
Jan 22nd, 2007
0

Re: Microsoft Access 2003 Validation Rule

...And to provide the final touch about the validation part configure your table column as follow:

Quote ...
At the time of field creation in design view...

Field Name: hours
Data Type: Number

And now the field general properties (at the bottom, in design view)

Field Size: Decimal
Scale: 2
Decimal Places: 2
Validation Rule: ([hours] * 100)Mod(25) = 0
Validation Text: The entered value should be in steps of 0.25
And voila, the field will work as you expected it to work....

PS: Moving this thread to the MS Access Forum...
Last edited by ~s.o.s~; Jan 22nd, 2007 at 1:26 pm.
Super Moderator
Featured Poster
Reputation Points: 3241
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,873 posts
since Jun 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS Access and FileMaker Pro Forum Timeline: MS Access validation rule help
Next Thread in MS Access and FileMaker Pro Forum Timeline: most populer query ?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC