It would help to know how you are using this. Are you calling the update from a form? If so the OnClick event of a button would work fine. If it is part of a larger routine (that is you are running a whole lot of things besides this update) then you would have to insert it in an appropriate place in the over all routine - where it makes sense.
I can answer your question better if you can fill me in on where, how and why you need to use this update in your app.
thanks for reply. let me tell u about my database. i want to make a database about student tution fee payment system. they have to pay weekly. so, if tomorrow (11/18/02) is the duedate then duedate will be changed (11/25/02). so duedate will be changed automatically every week and certain tution fee will be added to students account automatically either somebody open the form or not. i dont know i did make sense to u or not. let me know if u need more information.
You could update the due date each time the application is opened. Do you have a 'Splash' screen or maybe a Main Menu in your application?
If so you could run any automatic updates when that form is opened. To do this include your update query as part of the OnOpen event of the splash or menu form.
This will only help, of course, if the application is closed down and reopened on a regular basis (if all due dates for all student are the same, eg - each Monday, then the app would only need to be run once a week to ensure the dates are updated. If students have different due dates from each other, then the app should be opened daily (or there could be a button to run the update manually) to catch all possible updates). The down-side of this method is that the routine will run each time the application is opened and, depending on the size of the database, it maybe annoying to have to wait for the updates to run. However, I don't think that this update should impact (time-wise) things too much. This is probably the most straight forward way of doing it. I hope this makes sense.
It would also be possible to create a scheduler function, based on a timer event, to check to see if any dates need to be updated. This would be paticularly useful if the application remains open, but it also requires a little more involved coding.
Let me know if this will work for you. If not, we can always try again )