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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update & Clear On Specific Date

Status
Not open for further replies.

greysquirl

Programmer
Jan 31, 2001
27
US
I have several check boxes (Check1, Check2 etc.) and several text boxes (Text1, Text2 etc.). What I want to happen with the check boxes is on January 1st of every year I want the check boxes to clear out. For the text boxes I want them to clear out but only when I make changes to Text0 and then at that time I want them to be cleared and stored in another table.
 
You CAN do this, but I think it is somewhat weird.

To clear the check boxes on JAN. 1, the db would need to be 'running' on New Year's Day. For Most business apps, this just won't happen. What you really need is to clear them the first time the app is run during the calendar year.

to do this, you need to save the last time they were cleared (at least the year, but you may as well save the entire date/time thinggy). You could do this in a registry setting, but since you are asking this question, I'm guessing you don't really want to start including registry calls to your program. the alternative would be to set up a table in your db to hold miscellaneous info, such as this date. You may do this in many ways, but I'll suggest that you hace two(2) fields. ItemId and ItemData. Both should be string. ItemId would be the NAME of the Item and the ItemData the value. For the specific entry, You could use "ReSetDate" for ItemID and the date time stamp as the ItemData.

In the startup object, check the year of the current date aginst the information stored in the table. If they differ, call a routine which clears the ckeck boxes and places the current date/time in the table.

You can also place other occassionally changed bits of information in the table and look them up using a similar process.

For the textbox thing, when you set the value of text0, you can place code in the afterupdate event to save the record and either advance to the "New Record" (for bound forms) or to clear the text boxes.
MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top