Data validation to add 30 days

punter

Registered User.
Local time
Today, 16:56
Joined
Nov 24, 2006
Messages
108
Hi,

I'm new to access but picking it up as fast as I can. I'm putting together a form and was wondering if someone could help with the validation on one of the fields.

The two fields in question are BOL Date and ETA. BOL Date is a regular date (02-02-07 for example). I'm looking to add 30 days to that number in the ETA field. I'm not sure exactly where to stick that. Does it go in the Validation Rules box? Do I need to a have a rule on both the table and the form? What exactly would the the validation rule be? I have been trying various combinations with the expression builder and I can't get it to work. Any help would be most welcome.

Thank you in advance for your help. This is a great site and I'm digging around for the answer right now myself.

Eddie.
 
You don't need to store that date, just use the DateAdd function in whatever you want to use (form, report, query, etc.) to show the date plus 30.

DateAdd("d",30,[BOL Date])
 
Thank you so much for your quick reply. I'm sure that code works great but I'm not sure where to put it. I have stuck it in a couple of different places but nothing seems to popluate the field with the BOL Date plus 30. Where would you suggest I enter the function?

Thanks

Eddie.
 
You shouldn't store calculated fields. All you need is to show it on a form and set the control source of the text box to that formula
 
Thank you so much Bob. That worked perfectly.

I can't wait until I have this program down cold. The learing process is fun though.

Eddie.
 
Oh, one other thing. I was reading in your sig i should click somewhere if someone helped me. Where should I click for you?
 
It's the white scales in the blue bar just above the post that a person posts.

Rep.png
 
Got it. I'll make sure to do that more in the future.
 

Users who are viewing this thread

Back
Top Bottom