We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Ms Access help !!!
Options

Midmac
Posts: 1,070 Forumite
in Techie Stuff
Ok im strugling abit with my project of making a car rental database system. Im only just starting and struggling.
I want the Yes No field to be yes if current mileage is over the mileage Limit

any one know how to do this in the validation rule?
i have tried things like " If Current Mileage > Milegae Limit then Alert=-1" but i keep getting an error. I havent a clue how to work access.
I want the Yes No field to be yes if current mileage is over the mileage Limit

any one know how to do this in the validation rule?
i have tried things like " If Current Mileage > Milegae Limit then Alert=-1" but i keep getting an error. I havent a clue how to work access.
:j Midmac Aka Crazy baby :j
0
Comments
-
You don't do this from the table - you do this through a query0
-
I think the validation rule is more for checking figures during data entry, hence you could have a validation rule on the current mileage field, when you enter the figure it can then check against the limit and display a box containing what you put in validation text.
e.g Validation rule "mileage > limit"
validation text "The mileage entered exceeds the limit"
This may be configurable as a warning so you can override and continue.
What I think you would be better with is a query, that updates your yes/no field based on the current & mileage.
You need to remember that Access is a database, and will hold entered data very well, but to manipulate it you really need to get a few queries running when certain things happen.
The query when run would compare the mileage and limit accross all your records and then change the yes/no to a yes where it exceeds the limit.0 -
You shouldn't really store the alert at all and unless the milage limit is different for every single car, you shouldn't store the milage limit at car level either.
Basically, the fact that the milage limit has been exceeded can always be calculated very easily from other data, so to store that fact is unnecessary and can lead to complications in the future.
What happens if the milage limit changes for the whole fleet / class of car / age of car / individual vehicle etc. You won't want to sweep through the whole database changing the alert.0 -
Ok ive sorted that problem. Onto the next.
I have made a subform but when i run it it opens in datasheet view rather than a Form view. I can choose to preview it as Form view but how do i make this the default. Heres a pic to explain what i mean::j Midmac Aka Crazy baby :j0 -
Go into the properties of the form, and change the default view to "Single Form"0
-
Cheers mobdayuk worked like a charm:j Midmac Aka Crazy baby :j0
This discussion has been closed.
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 350.9K Banking & Borrowing
- 253.1K Reduce Debt & Boost Income
- 453.5K Spending & Discounts
- 243.9K Work, Benefits & Business
- 598.7K Mortgages, Homes & Bills
- 176.9K Life & Family
- 257.2K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards