|
tech
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Show the date of the last time the query was runMy 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? On Sat, 20 Dec 2008 06:18:00 -0800, Mishanya wrote:
> My swithboard has a button wich runs an Update query (it updates one Just have your update query update the date field to Now(). > 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? -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com 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)? Show quoteHide quote "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 > On Sat, 20 Dec 2008 07:27:01 -0800, Mishanya wrote:
> Nice! Thank U! Well, in a database if you want to store data you need a table and field > 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)? 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 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. Show quoteHide quote "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 > On Sat, 20 Dec 2008 07:55:01 -0800, Mishanya wrote:
> Rick You need to issue a Requery on it in code...> 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. Me.ComboBoxName.Requery -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com In what event? And of what (the button that runs the query? the control
LastUpdateDate itself? the form?)? Show quoteHide quote "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 > 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 Well, yes if the change you expect to see in the ComboBox is because the > LastUpdateDate itself? the form?)? 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 thank You!
Show quoteHide quote "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 >
Display data horizontally using concatenation
Save Query Results to Multiple Tables Add "Record Created On" Field to a Query delete records from one table if not in another Use a current record to enter new data but keep the old data Permission Denied 2007 Need to create a search based on a specific field Search question Command button to open another database? Unlocking a Database in order to Edit Info |
|||||||||||||||||||||||