table & form connection - using Access 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I created a table w/start & end dates.
Then I created an auto form from that table w/ the fields.
I need the End field to calculate 3 months into the future from the Start
date.
I created an expression using (dateserial) and it worked.
But I had to change the Control Source and the results no longer shows in
the original table.
I want to know how to create an expression/code that will do the
calculations and will show in the original table???
 
rule of thumb is to *not* save calculated values as hard data in a table. if
you're saving the Start date in the table, then you can calculate an end
date three month in the future, any time you need it. reasons to save the
End date as hard data might be 1) the interval is subject to frequent
change, or 2) a standard interval needs to be modified on specific records
at the user's discretion - for example, the user may want to add 10 days to
a "+ 3 months" interval for a specific record.

if you have a sound reason to save the end date into a table, then you'll
need to set the value of the form control that's bound to the EndDate field.
suggest you run the following code in the StartDate control's AfterUpdate
event procedure, as

Me!EndDate = DateAdd("m", 3, Me!StartDate)

hth
 
Create a query on that table that includes the expression as a column. You
do not (and should not) save the calculation to the table since it can be
recalculated as necessary. Connect your form to the query instead of the
table.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top