If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Show the date of the last time the query was run
My swithboard has a button wich runs an Update query (it updates one table
fields from another table linked to Excel datasheet). I run the query only when the data in Excel has been changed. At times I have to print some reports with old unupdated data and only then perform the Update. I'd like to add LastUpdate field on the switchboard, wich will show the date when the query was run last time (in other words, a date the data is updated to). Creating Date field with a default value of Now() in the updated table and then pulling it's DMax woud not help, cause the query is not adding new records, so the max value will remain always the same (the same value of the date of creating the records). What can be done? Is there a way to timestamp query-run or table's data-update? |
#2
|
|||
|
|||
Show the date of the last time the query was run
On Sat, 20 Dec 2008 06:18:00 -0800, Mishanya wrote:
My swithboard has a button wich runs an Update query (it updates one table fields from another table linked to Excel datasheet). I run the query only when the data in Excel has been changed. At times I have to print some reports with old unupdated data and only then perform the Update. I'd like to add LastUpdate field on the switchboard, wich will show the date when the query was run last time (in other words, a date the data is updated to). Creating Date field with a default value of Now() in the updated table and then pulling it's DMax woud not help, cause the query is not adding new records, so the max value will remain always the same (the same value of the date of creating the records). What can be done? Is there a way to timestamp query-run or table's data-update? Just have your update query update the date field to Now(). -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#3
|
|||
|
|||
Show the date of the last time the query was run
Nice! Thank U!
For general knowledge - is there any way to accomplish the task without creating superficial and otherwise useless fields (I don't need this LastUpdate field as such)? "Rick Brandt" wrote: On Sat, 20 Dec 2008 06:18:00 -0800, Mishanya wrote: My swithboard has a button wich runs an Update query (it updates one table fields from another table linked to Excel datasheet). I run the query only when the data in Excel has been changed. At times I have to print some reports with old unupdated data and only then perform the Update. I'd like to add LastUpdate field on the switchboard, wich will show the date when the query was run last time (in other words, a date the data is updated to). Creating Date field with a default value of Now() in the updated table and then pulling it's DMax woud not help, cause the query is not adding new records, so the max value will remain always the same (the same value of the date of creating the records). What can be done? Is there a way to timestamp query-run or table's data-update? Just have your update query update the date field to Now(). -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#4
|
|||
|
|||
Show the date of the last time the query was run
Rick
Just one more tuning quest How can I make the switchboard LastUpdate control update it's contain (to change the date) after the query is finished? Now it only updates after closing and opening the form again. "Rick Brandt" wrote: On Sat, 20 Dec 2008 06:18:00 -0800, Mishanya wrote: My swithboard has a button wich runs an Update query (it updates one table fields from another table linked to Excel datasheet). I run the query only when the data in Excel has been changed. At times I have to print some reports with old unupdated data and only then perform the Update. I'd like to add LastUpdate field on the switchboard, wich will show the date when the query was run last time (in other words, a date the data is updated to). Creating Date field with a default value of Now() in the updated table and then pulling it's DMax woud not help, cause the query is not adding new records, so the max value will remain always the same (the same value of the date of creating the records). What can be done? Is there a way to timestamp query-run or table's data-update? Just have your update query update the date field to Now(). -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#5
|
|||
|
|||
Show the date of the last time the query was run
On Sat, 20 Dec 2008 07:27:01 -0800, Mishanya wrote:
Nice! Thank U! For general knowledge - is there any way to accomplish the task without creating superficial and otherwise useless fields (I don't need this LastUpdate field as such)? Well, in a database if you want to store data you need a table and field to store it in. You could have a separate table for this so that the date only needs to be stored once instead of in every record of your current table, but that would be more difficult to manage and ensure that the date is correct since it would require a *separate* step from running the update query. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#6
|
|||
|
|||
Show the date of the last time the query was run
On Sat, 20 Dec 2008 07:55:01 -0800, Mishanya wrote:
Rick Just one more tuning quest How can I make the switchboard LastUpdate control update it's contain (to change the date) after the query is finished? Now it only updates after closing and opening the form again. You need to issue a Requery on it in code... Me.ComboBoxName.Requery -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#7
|
|||
|
|||
Show the date of the last time the query was run
In what event? And of what (the button that runs the query? the control
LastUpdateDate itself? the form?)? "Rick Brandt" wrote: On Sat, 20 Dec 2008 07:55:01 -0800, Mishanya wrote: Rick Just one more tuning quest How can I make the switchboard LastUpdate control update it's contain (to change the date) after the query is finished? Now it only updates after closing and opening the form again. You need to issue a Requery on it in code... Me.ComboBoxName.Requery -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#8
|
|||
|
|||
Show the date of the last time the query was run
On Sat, 20 Dec 2008 13:30:01 -0800, Mishanya wrote:
In what event? And of what (the button that runs the query? the control LastUpdateDate itself? the form?)? Well, yes if the change you expect to see in the ComboBox is because the query has been run then you need to run that code after the query has been run. If you execute the query from code then issuing the Requery in that same code block would be appropriate. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#9
|
|||
|
|||
Show the date of the last time the query was run
thank You!
"Rick Brandt" wrote: On Sat, 20 Dec 2008 13:30:01 -0800, Mishanya wrote: In what event? And of what (the button that runs the query? the control LastUpdateDate itself? the form?)? Well, yes if the change you expect to see in the ComboBox is because the query has been run then you need to run that code after the query has been run. If you execute the query from code then issuing the Requery in that same code block would be appropriate. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
Thread Tools | |
Display Modes | |
|
|