Update Date in Multiple Forms

MadeCurler

enthusiastic pensioner
Local time
Today, 19:13
Joined
Dec 6, 2007
Messages
49
Each record in my form(s) has a "Last Updated" button which updates a text box with today's date. The DB opens with a "Switchboard" with links to each form. I would like to place a button on the Switchboard that says something like "Update All Records".....any advice?

Thanks in advance
 
Each record in my form(s) has a "Last Updated" button which updates a text box with today's date.
If you have a form based on a table, then you only have one set of controls, and many records, not 1 set of controls for each record. Just clarifying that...
I would like to place a button on the Switchboard that says something like "Update All Records".....any advice?
Yes, place a button on it and write yourself a few lines of "UPDATE" SQL in the button's click event. If you're only updating one table, it should be easy, but if you're updating all of your tables, you may have to write a loop.

This can also be done in the query grid, and using the button, you can run the query that is built.

BTW, what's your handicap? :)
 
Adam
Thanks. I have 8 forms derived from one table. Each Form is based on a query from the main table, selected by "Region_Number". From the Switchboard I can select "View Clients From Region 1". If I'm in (say) Region 1 and I update any field I can click a button on that form which places today's date in a text box. I frequently update nearly all the records from all 8 regions and rather than click each record from each region (260 in all) I would like to have a button on the main Switchboard that says "Update All Records" that when clicked executes some code that places today's date in all records. On a more important note I play off 8 - you?
 
If I'm in (say) Region 1 and I update any field I can click a button on that form which places today's date in a text box. I frequently update nearly all the records from all 8 regions and rather than click each record from each region (260 in all) I would like to have a button on the main Switchboard that says "Update All Records" that when clicked executes some code that places today's date in all records.
If I had to go through 200+ records and do this, I would have put a button on my desk before I even created the database, in anticipation of the anxiety! :D If the texbox on your form (for each) record represents a field in the table, and all the records you want to update are in the same table, then this is really quite simple. The code for the button's click event...
Code:
docmd.runSQL "UPDATE TableName SET
   TableName.FieldName = Date()"
End of Story.
On a more important note I play off 8 - you?
That definately is a more important note! I used to be about a 6, but that was a few years ago. I live in a place though, that does have a winter, and yes I don't like it, and yes, I wish I was in Nevada, maybe Las Vegas, or Florida, and playing golf everday! :)
 
Adam...That works thanks very much...Regards Bill
 

Users who are viewing this thread

Back
Top Bottom