We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 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 !!!

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
help2ol.jpg

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

Comments

  • You don't do this from the table - you do this through a query
  • 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.
  • 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.
  • Midmac
    Midmac Posts: 1,070 Forumite
    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:
    help9ud.jpg
    :j Midmac Aka Crazy baby :j
  • mondayuk
    mondayuk Posts: 70 Forumite
    Go into the properties of the form, and change the default view to "Single Form"
  • Midmac
    Midmac Posts: 1,070 Forumite
    Cheers mobdayuk worked like a charm ;)
    :j Midmac Aka Crazy baby :j
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 352.4K Banking & Borrowing
  • 253.7K Reduce Debt & Boost Income
  • 454.4K Spending & Discounts
  • 245.4K Work, Benefits & Business
  • 601.3K Mortgages, Homes & Bills
  • 177.6K Life & Family
  • 259.3K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.