468,241 Members | 1,571 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,241 developers. It's quick & easy.

Production Date/Expiry Date (Update)

"Marshall Barton" <ma*********@wowway.com> wrote in message
news:9a********************************@4ax.com...
William Bradley wrote:

I have two cells on a form. One of them is the "Production Date" and the
other is the "Expiry Date". The "Expiry Date" is 183 days after the
"Production Date."

On an Excel spreadsheet, the "Expiry Date" is automatically entered, when
the "Production Date" is entered. To do this the "Expiry Date" cell carries
the following formula: "=A15+183".

I would like to be able to do the same on an Access Form, with the results
written to the underlying table.

I think what you're asking for can be done by using a line
of code in the Production Date text box's AfterUpdate event
procedure:

txtExpiryDate = DateAdd("d", 183, txtProductionDate)


Thank you for the above Marsh. I already have a line of code in the "After
Update" of the "ProductionDate" field. Is it possible to add yours, above,
as well? If so how? I tried it and it didn't work, probably due to my
missing something out.

Is there a way of accomplishing the same result using the "Expiry Date"
field.

Thank you,

Bill.

Nov 12 '05 #1
2 3151
William Bradley wrote:

"Marshall Barton" <ma*********@wowway.com> wrote in message
news:9a********************************@4ax.com...
William Bradley wrote:

I have two cells on a form. One of them is the "Production Date" and the
other is the "Expiry Date". The "Expiry Date" is 183 days after the
"Production Date."

On an Excel spreadsheet, the "Expiry Date" is automatically entered, when
the "Production Date" is entered. To do this the "Expiry Date" cell carries
the following formula: "=A15+183".

I would like to be able to do the same on an Access Form, with the results
written to the underlying table.

I think what you're asking for can be done by using a line
of code in the Production Date text box's AfterUpdate event
procedure:

txtExpiryDate = DateAdd("d", 183, txtProductionDate)
Thank you for the above Marsh. I already have a line of code in the "After
Update" of the "ProductionDate" field. Is it possible to add yours, above,
as well?


Yes. You can add many lines of code to an event.

If so how? I tried it and it didn't work, probably due to my missing something out.
I would dblclick on the field for ExpiryDate and pull up the property
sheet, then click the Other tab. What is the Name field value? Change
txtExpiryDate to that name or do something like
Me.YourExpiryDateFieldName = DateAdd("d", 183,
Me.YourProductionDateFieldName)
Is there a way of accomplishing the same result using the "Expiry Date"
field.


Yes. Since the date is calculated, remove the code in the AfterUpdate
event. Then enter
=DateAdd("d", 183, Me.YourProductionDateFieldName)
as your ControlSource found under the Data tab of the field. Make sure
the name matches the Name field of the field.
Nov 12 '05 #2
"Patrick Finucane" <fi******@mindspring.com> wrote in message
news:3F***************@mindspring.com...
I would dblclick on the field for ExpiryDate and pull up the property
sheet, then click the Other tab. What is the Name field value? Change
txtExpiryDate to that name or do something like
Me.YourExpiryDateFieldName = DateAdd("d", 183,
Me.YourProductionDateFieldName)
Is there a way of accomplishing the same result using the "Expiry Date"
field.


Yes. Since the date is calculated, remove the code in the AfterUpdate
event. Then enter
=DateAdd("d", 183, Me.YourProductionDateFieldName)
as your ControlSource found under the Data tab of the field. Make sure
the name matches the Name field of the field.


Thank you Patrick, the first solution above worked fine.

Bill.
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by What-a-Tool | last post: by
4 posts views Thread by ianv2 | last post: by
4 posts views Thread by William Bradley | last post: by
12 posts views Thread by shane.taylor81 | last post: by
1 post views Thread by janna48 | last post: by
reply views Thread by mplpost | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.