Carry Over Date

G

Guest

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.
 
G

Guest

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
 
G

Guest

I think what you really meant to say is

Me![LastServiceDate].DefaultValue = Me![CurrentServiceDate]

As posted, your code would change the last service date in the current record.
--
Dave Hargis, Microsoft Access MVP


Beetle said:
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

Nikki said:
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.
 
G

Guest

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


Beetle said:
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

Nikki said:
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.
 
G

Guest

Reread my previous post.
--
Dave Hargis, Microsoft Access MVP


Nikki said:
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


Beetle said:
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

Nikki said:
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.
 
G

Guest

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


Klatuu said:
Reread my previous post.
--
Dave Hargis, Microsoft Access MVP


Nikki said:
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


Beetle said:
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.
 
G

Guest

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


Nikki said:
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


Klatuu said:
Reread my previous post.
--
Dave Hargis, Microsoft Access MVP


Nikki said:
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.
 
G

Guest

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


Klatuu said:
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


Nikki said:
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


Klatuu said:
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.
 
G

Guest

Don't know why it is not working, but here is an alternative that may get it.
In the After Update event for CurrentDate

Me![DateofLastServ].Tag = Me![CurrentDate]

Then in the form Current event:

If Me.NewRecord Then
Me![DateofLastServ] = Me![DateofLastServ].Tag
End If
--
Dave Hargis, Microsoft Access MVP


Nikki said:
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


Klatuu said:
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


Nikki said:
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.
 
G

Guest

Thanks there obviously is something going wrong somewhere. That last idea
made it work, but now I can't open the Form without getting an error. So at
least I got an answer to the one question I didn't know. So I will have to do
some searching to find out why it is causing trouble now. Thanks so much for
the help!
--
Thanks,
Nikki


Klatuu said:
Don't know why it is not working, but here is an alternative that may get it.
In the After Update event for CurrentDate

Me![DateofLastServ].Tag = Me![CurrentDate]

Then in the form Current event:

If Me.NewRecord Then
Me![DateofLastServ] = Me![DateofLastServ].Tag
End If
--
Dave Hargis, Microsoft Access MVP


Nikki said:
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


Klatuu said:
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.
 
G

Guest

What is the error you are getting when you open the form?
--
Dave Hargis, Microsoft Access MVP


Nikki said:
Thanks there obviously is something going wrong somewhere. That last idea
made it work, but now I can't open the Form without getting an error. So at
least I got an answer to the one question I didn't know. So I will have to do
some searching to find out why it is causing trouble now. Thanks so much for
the help!
--
Thanks,
Nikki


Klatuu said:
Don't know why it is not working, but here is an alternative that may get it.
In the After Update event for CurrentDate

Me![DateofLastServ].Tag = Me![CurrentDate]

Then in the form Current event:

If Me.NewRecord Then
Me![DateofLastServ] = Me![DateofLastServ].Tag
End If
--
Dave Hargis, Microsoft Access MVP


Nikki said:
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.
 

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

Similar Threads


Top