Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expiration with a drop down menu?

Status
Not open for further replies.

Dird

MIS
Jan 21, 2007
5
GB
Hi i've made a database providing warranty on products. like with the table the form has start date, end date and type of warranty. I'm looking for a way to make it automatically update when the warranty has expired.

the warranty form has a drop down menu for type of warranty with the options "gold" "silver" and "expired". i'm looking for a way for that to automatically change to expired when the end date has passed

can anyone help? <3
 
Hello Dird
Please read faq181-2886 carefully.
 
ah sorry
i cant see an option to edit my initial post so:
i'm using Access 2003
I tried writing an if statement but it didnt work. I tried IIf(Date()>tblWarranty!End_Date, "Expired")
I then tried placing the code provided here into the drop down menu and manipulating it to fit my database but it didnt work either
 
You need to decide how this is to happen. For example,
- Each day someone will click a button (update query);
- Someone will examine all expired warranties (form);
- When the record is examined, the warraty will be updated (form).

Say you go for the first option, you need to create a small form with a command button. When this button is clicked, a query to update the records will run. Thread701-1321476 is suitable for this idea.

Option 2 would involve creating a query that selects records that expire today, or within a suitable date range. This would then be used as the record source of a form. This could blend with option 3, in that you could add an update button, or automatically update each record as it is viewed. For this idea to work, you only need a little code in the Current event of the form or attached to a command button.

What do you see happening with your application?
 
I've changed my approach now. I'm just going to use the warranty options active/expired in a textbox.

All i want it to do is for it to go from active (default setting) to expired when the years warranty has passed. This would show in the form and the table that it's sourced from. I think there'll prob be something on the site with this approach so i'll have a look
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top