Validation Rules

G

Guest

I'm trying to work out a validation rule (either in a table or form) and
getting no where.
The bottom line is this: I would like the user to enter a number in a
field, but that number must be greater than or equal to that field's number
from the previous day's record.

ie: if yesterday's number was 150, then todays entry must be greater than or
at least equal to 150.
 
M

missinglinq via AccessMonster.com

Have a look at the DMax function.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 
M

missinglinq via AccessMonster.com

Something like this:

Private Sub YourField_BeforeUpdate(Cancel As Integer)
If Me.YourField < DMax("[YourField]", "YourTable") Then
MsgBox "You Must enter a Value Equal To or Greater Than Yesterday's
Value"
Cancel = True
End If

End Sub

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top