Thanks for continuing to help
Private Sub CurrentDate_AfterUpdate()
Me![DateofLastServ].DefaultValue = Me![CurrentDate]
End Sub
I put this in the AfterUpdate Event of the CurrentDate field.
I also read something about the format mattering. I have it set to general
date.
I add a new record, I put today's date in the Current date field. With this
in the event the DateofLastServ stays blank. When I use the other it changes
to the same date, but that is what I meant it actually shows that it did
something. Not what I want, but something.
--
Thanks,
Nikki
:
Nikki,
This is a very common way to do this. If it is not working, there is
another issue.
When you say "it is not doing anything", what, exactly do you mean?
You will not see anything until you add a new record. When you do, the Last
Service Date control should have the value that was set in the previous
record.
--
Dave Hargis, Microsoft Access MVP
:
When I put that in the AfterUpdate it doesn't do anything. So I am not sure
where to go from there. The other suggestion showed that it was doing
something.
--
Thanks,
Nikki
:
Reread my previous post.
--
Dave Hargis, Microsoft Access MVP
:
Thanks for the date warning-
I did what you had suggested, and the Last Service date field just reads the
same as the current service date. So on the record both dates say the same
thing. I need it to grab the date that was listed on the previous record in
the Current Service record date because now that I have a new service that
date has become the last service. It is hard to explain, but hopefully it
makes sense.
Thanks for the help.
--
Thanks,
Nikki
:
The word "Date" is a reserved word in Access and should not be used as a
field or control name because it can cause problems later on. You should
change the name of this field if possible. Maybe [CurrentServiceDate] or
something like that. See this link for a list of reserved words;
http://support.microsoft.com/default.aspx/kb/286335
As to your question, you could use the After Update event of your
"[CurrentServiceDate]" text box to set the value of [LastServiceDate]
Example;
CurrentServiceDate_AfterUpdate
Me![LastServiceDate] = Me![CurrentServiceDate]
End Sub
HTH
:
I have a subform that is used to show all the service records for a piece of
equipment. There is a textbox on the form that is linked to a field titled
[Date]. This shows the date the service was performed. There is also a field
on the subform [LastServDate]. I want the [Date] information in the previous
record to populate the [LastServDate] field on the new service record. Thanks
for your help if you need a better explanation let me know.