A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Show the date of the last time the query was run



 
 
Thread Tools Display Modes
  #1  
Old December 20th, 2008, 03:18 PM posted to microsoft.public.access.gettingstarted
Mishanya
external usenet poster
 
Posts: 197
Default 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  
Old December 20th, 2008, 03:39 PM posted to microsoft.public.access.gettingstarted
Rick Brandt
external usenet poster
 
Posts: 4,354
Default 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  
Old December 20th, 2008, 04:27 PM posted to microsoft.public.access.gettingstarted
Mishanya
external usenet poster
 
Posts: 197
Default 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  
Old December 20th, 2008, 04:55 PM posted to microsoft.public.access.gettingstarted
Mishanya
external usenet poster
 
Posts: 197
Default 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  
Old December 20th, 2008, 05:13 PM posted to microsoft.public.access.gettingstarted
Rick Brandt
external usenet poster
 
Posts: 4,354
Default 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  
Old December 20th, 2008, 05:14 PM posted to microsoft.public.access.gettingstarted
Rick Brandt
external usenet poster
 
Posts: 4,354
Default 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  
Old December 20th, 2008, 10:30 PM posted to microsoft.public.access.gettingstarted
Mishanya
external usenet poster
 
Posts: 197
Default 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  
Old December 20th, 2008, 10:47 PM posted to microsoft.public.access.gettingstarted
Rick Brandt
external usenet poster
 
Posts: 4,354
Default 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  
Old December 20th, 2008, 11:23 PM posted to microsoft.public.access.gettingstarted
Mishanya
external usenet poster
 
Posts: 197
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.