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

equation in a button

Status
Not open for further replies.

brh01

Technical User
Feb 23, 2003
103
I want a button on my form to, when pressed, add "1" to a number in an adjacent text box. but the button can only work once a day. any ideas? thanks in advance.

Brian
 
I'm away from my main PC and don't have Access on this machine, so can't knock out the exact answer, but I'd have a utility table set up with a single record (I use one to enter all corporate ID data, like phone numbers, address etc) with a field for the date.

Check the current date against this value, and if they are the same, do nothing. If they are different, increment your value by one, and write the new value to the table.

Hope this helps.

The Missinglinq

"It's got to be the going,
not the getting there that's good!"
-Harry Chapin
 
maybe you could put something like this.
Name a command button e.g >"Click".Then make a textbox(call > "Input" and make sure it is bound to table. On the command button event "on click", write this code > me.input.value= 1.
then to make it open only once a day,click the properties of the form,and go to the record source, click the box next to it and you will be prompt wether u want to change the queries, click yes. And inside the queries,put all field and under the "Input" criteria type > <>1.
And the you have it..
 
i would save the 'time stamp' that the button was last pressed to the registry, then when the button is clicked then just check the time stamp from teh registry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top