Place update date value from a table into form

G

Guest

When my form updates its table I save the last date updated to a separate
table. I just add the last update date keeping all prior update dates. I
also have a parameterized form that calls all reports for my system. I am
trying to extract the last date from this last update table then print the
last update on the report as it prints.

I thought I could dim a recordset, define the recordset as the last update
table, move to the last record in the record, and store that value to a
textbox on the form, but I have not been able to get that to work. Could you
please tell me how to obtain this value and pass it to various reports?

Thank you,
Garry
 
R

Rick Brandt

GarryT said:
When my form updates its table I save the last date updated to a
separate table. I just add the last update date keeping all prior
update dates. I also have a parameterized form that calls all
reports for my system. I am trying to extract the last date from
this last update table then print the last update on the report as it
prints.

I thought I could dim a recordset, define the recordset as the last
update table, move to the last record in the record, and store that
value to a textbox on the form, but I have not been able to get that
to work. Could you please tell me how to obtain this value and pass
it to various reports?

Thank you,
Garry


Keep it simple...

=DMax("FieldName", "TableName")
 
G

Guest

I tried to retrieve it, but I still can't. Also I can't seem to get Debug to
work. Do you know if I could have turned it off someway. Without Debug it
is hard to see what I am doing wrong.

I have a textbox on the form named txtRptDate. Based on your suggestion, I
am trying the following command:
txtRptDate = DMax("lastupdate", "LastUpdated")
I would like the date to appear in the textbox. Could you tell me what I am
doing wrong.

Thanks so much,
Garry
 
R

Rick Brandt

GarryT said:
I tried to retrieve it, but I still can't. Also I can't seem to get
Debug to work. Do you know if I could have turned it off someway.
Without Debug it is hard to see what I am doing wrong.

I have a textbox on the form named txtRptDate. Based on your
suggestion, I am trying the following command:
txtRptDate = DMax("lastupdate", "LastUpdated")
I would like the date to appear in the textbox. Could you tell me
what I am doing wrong.

Thanks so much,
Garry

Unless you intend to re-save this value into another table (usually a bad idea)
then you don't need any code at all. Just use a ControlSource of...

=DMax("lastupdate", "LastUpdated")

....for your TextBox.
 
G

Guest

Thanks Rick that worked great. Would you know why I can't get the system to
stop at breakpoints any more. It must be a setting, but I haven't been able
to find it.

Thanks,
Garry
 
R

Rick Brandt

GarryT said:
Thanks Rick that worked great. Would you know why I can't get the
system to stop at breakpoints any more. It must be a setting, but I
haven't been able to find it.

I have vague recollections of others reporting that though I have never seen it.
Have you tried compacting/repairing or doing a save and compile all on the
project?
 
G

Guest

I tried both of those but still can't debug. If you find anything out please
let me know. I can't continue programming my system until I can turn debug
back on.

Thanks,
Garry
 
R

Rick Brandt

GarryT said:
I tried both of those but still can't debug. If you find anything
out please let me know. I can't continue programming my system until
I can turn debug back on.

If you create a new blank file and create a new module within, can you get
breakpoints to work in that?
 
G

Guest

Hi Rick,

I found the answer. It's under tools, customize, toolbars. You must have
"Source Code Control" checked or you don't have debug. I have it back now.
Thanks for all you help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top