473,657 Members | 2,932 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 10053
"William Bradley" <br******@magma .ca> wrote in message
news:zf******** ************@ma gma.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************ *****@ucsfmedct r.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*********@wo wway.com> wrote in message
news:9a******** *************** *********@4ax.c om...
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, txtProductionDa te)


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*********@wo wway.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, txtProductionDa te)


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 txtProductionDa te 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
19878
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 = Date().toLocaleString(); Response.Cookies("Test").Expires = Date().toString(); Response.Cookies("Test").Expires = Date().toUTCString();
1
10966
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 '//Read cookie... ExpDate = Request.cookies("Propsect") Response.write "Prospect expiry date: " & expDate & "<br>"
2
8314
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 program which will be used to encrypt and decrypt the licence key from the licence text file. With RSA, I want to hardcode a plain text as a private key in the C/C++ program, and store a signed public-key (the licence key - also include an expiry...
4
2841
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 of July 31, if I
2
3512
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 "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...
3
9204
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 one particular expiry date could have multiple products I am thinking of two approaches not knowing which one to go for. First design is of one product having many expiry dates (a one to many
1
1861
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 are finally checked. Please help
0
2388
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 expiry would be one year from the date of start date. Is there any "ALTER CERTIFICATE" command to update the expiry date without dropping and recreating the keys and certificates. Thanks, MPL
1
2592
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, emailid, password, regdate, expiry (expiry date). I want the autentication script to validate with emailid, password and expiry. <?php include "dbCon.php";
0
8820
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8718
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8499
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7314
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.