473,405 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Production Date/Expiry Date

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.

Any help is appreciated,

Bill.
Nov 12 '05 #1
4 10025
"William Bradley" <br******@magma.ca> wrote in message
news:zf********************@magma.ca...
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.


This all made perfect sense until the last sentence. Why do you want to store this
value rather than calculate it on the fly? That is what Excel is doing. Why not
have Access do the same? Storing this in the table would make as much sense as
writing a macro in Excel that would Add 183 to the values found in column A and
writing the result to column B. Then every time you change something in column A you
would re-run the macro to make sure that column B is correct. Sounds silly when you
can just enter an expression in column B to do all of this for you automatically
doesn't it?

Just use a control on the form with an expression as its ControlSource that will do
the calculation and display the result. Saving it to the table accomplishes nothing
useful.
Nov 12 '05 #2
"Tim Satterwhite" <ti*****************@ucsfmedctr.org> wrote in message
news:bj*********@itssrv1.ucsf.edu...
Not to get too far off the subject, but it might be useful to store the
expiry date.

If the user is allowed or required by business practice (say, in the case of negotiations with the database user's customers) to override the default of production + 183 days, then it needs to be stored.

Of course, this all depends on what the purpose of "production" and "expiry" are. Whether the data should be stored or not is totally dependent on the
need for that derived information.


We manufacture biological products used in both medical, veterinary,
industrial and food investigations. We need to have hard coded information
on both the production date and expiry date of each product as it is
produced.

Bill.
Nov 12 '05 #3

"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 carriesthe following formula: "=A15+183".

I would like to be able to do the same on an Access Form, with the resultswritten 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, abvove,
as well? If so how? I tried it and it didn't work, probably due to my
missing something out.

Thank you,

Bill.
Nov 12 '05 #4
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" cellcarries >the following formula: "=A15+183".
>
>I would like to be able to do the same on an Access Form, with theresults >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, abvove,
as well? If so how? I tried it and it didn't work, probably due to my
missing something out.


Sure you can add a line of code to your existing procedure.

That line is simple enough that I can't see how you could be
leaving something out. Maybe you didn't change the names I
used to the ones you're using. Make sure that you replace
txtExpiryDate with the name of the text box bound to the
Expiry Date field. Similarly change txtProductionDate to
the name of the text box bound to the Production Date field.

--
Marsh
Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Vince C. | last post by:
Hi all. I'm trying to set a cookie expiry date but my script is JS (JavaScript). I've tried Response.Cookies("Test").Expires = Date(); Response.Cookies("Test").Expires =...
1
by: | last post by:
How does one read and write the cookie expiration date. At the moment my code is returning a value BUT a garbled value: '//Write cookie... Response.Cookies("Propsect").Expires = Date() + 1 ...
2
by: Dave | last post by:
Hi, Can anyone suggest a way to generate a licence key from C/C++ program? I want to create a licence file include an encrypted text and an expiry date. The private key is hard coded in the...
4
by: ianv2 | last post by:
Hi Is the following possible using Javascript ? I would like a page to redirect to another page if the page expiry has passed. E.G. If my questionnaireform.html page had an expiry date...
2
by: William Bradley | last post by:
"Marshall Barton" <marshbarton@wowway.com> wrote in message news:9as9lvgpnp783kogctb88c8giaepb5uf6g@4ax.com... > William Bradley wrote: > >I have two cells on a form. One of them is the...
3
by: hasanainf | last post by:
Hi all, What will be the best database design for an inventory control that uses expiry date for its products. Over a period of time, a particular product will have many expiry date and that...
1
by: Rob Kell | last post by:
I have a vb.net application that emails people daily information. I want to set an expiry for the email so that those who cannot check their emails for a period are not loaded with them when they...
0
by: mplpost | last post by:
We have created a Certificate for the purpose of symmetric encryption. We did not mention the expiry date explicitly, only later we found out that, if expiry date not mentioned then the default...
1
by: tutusaint | last post by:
I have a user login authentication scrip which validates users emailid and password. I want it to also check and validate users expiry date in the database. I have user details like name,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.