473,385 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help with validation rule

I have a database that I use to track odometre readings. Several
vehicles are tracked. As you can imagine, if the wrong vehicle is
entered for the given mileage, it will through off reporting. I would
like to include some kind of validation or error checking.

1) Display or check against the last entered record for the vehicle
(by DATE).

2) Then doesn't allow the new entry to be less than the last one or
500 km more than the last one.

I'm by no means an expert with Access.

Magic
Nov 13 '05 #1
2 1237
On 11 Mar 2005 05:42:46 -0800, el**********@yahoo.com (Electricsuit)
wrote:

This is somewhat hard to do in a validation expression, but you can
write some code in the Form_BeforeUpdate event.
You can use DMax function to get the max odometer reading for that
vehicle.
If you have lots (>10,000) of rows, a parameter query may be much more
efficient, but requires more skills on your part.

-Tom.

I have a database that I use to track odometre readings. Several
vehicles are tracked. As you can imagine, if the wrong vehicle is
entered for the given mileage, it will through off reporting. I would
like to include some kind of validation or error checking.

1) Display or check against the last entered record for the vehicle
(by DATE).

2) Then doesn't allow the new entry to be less than the last one or
500 km more than the last one.

I'm by no means an expert with Access.

Magic


Nov 13 '05 #2
Tom van Stiphout wrote:
On 11 Mar 2005 05:42:46 -0800, el**********@yahoo.com (Electricsuit)
wrote:

This is somewhat hard to do in a validation expression, but you can
write some code in the Form_BeforeUpdate event.
You can use DMax function to get the max odometer reading for that
vehicle.
If you have lots (>10,000) of rows, a parameter query may be much more
efficient, but requires more skills on your part.


Then add some more code when the vehicle has its engine replaced :-)

--
This sig left intentionally blank
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
2
by: qsweetbee | last post by:
I have a form(fAddUsers) in my database. It is continue form for data entry. Some fields are required fields. Some are optional fields. There is 1 particular filed(TokenExpirationDate)on the form...
3
by: Earthling | last post by:
Any help would be appreciated to solve the following simple problem that I will describe. *** There is a form called "red chocolate form". The form has a particular subform field that has a...
5
by: Don Sealer | last post by:
I've got a validation rule that says something like =xx or xxx or zzzz. Though I may not have described it well it does work fine and that is really not my question. Here's what I'd like to do....
3
by: BrianB830 | last post by:
Hello all, I have a quick question regarding an MS Access database I'm creating. In the entity "ORDER", I have the attributes "Order Date" and "Delivery Date". I need to create a validation...
2
by: Lebowski | last post by:
How ValidationRule for data/hour field should I formulate if I wanted that date to be prior/earlier than another date in other data/hour field in the same table? How syntax/notation about...
4
by: ron | last post by:
I have a access based guest book. I want to create a validation rule to block certain words or parts of a srting. How do i do this? ie: this is a nice site. come visit my porn site at www.abc.zy...
10
by: gweasel | last post by:
What is the best way to apply a Validation Rule - or rather, where is the best place to put it? Is there an advantage to putting it on the field in the table vs setting the validation rule on the...
1
by: MLH | last post by:
Anyone remember if A97 append query failure would ever report data breaking validation rule when such was not the case. I have an old SQL statement - several years old now. I've encountered a case...
1
by: DBlearner | last post by:
I'm surprised I couldnt find a question about this here so guess I better ask. I have a form with two date fields. and . Obviously, Enddate cannot predate Startdate field so I decided to do a...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.