By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,453 Members | 3,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,453 IT Pros & Developers. It's quick & easy.

Access to auto populate a date in field2 once field one is populated

P: 9
Hi: I have two fields, First follow up date sent email. I want the second field, Second follow up date sent email, to auto populate seven days into the future. this is on a Access form. How and where would the expression be placed in which field first follow up or second followup field. On the table or the form
Aug 21 '17 #1

✓ answered by PhilOfWalton

Pure Guess: I would have thought you would have updated the First Field and calculate the second from it, in which case the code should be

Expand|Select|Wrap|Line Numbers
  1. Me!SecondDate = DateAdd("d",7, Me!FirstDate)
  2.  
Sorry can't be bothered with your 35 letter field definitions. I'm a rotten typist.

Phil

Share this Question
Share on Google+
7 Replies


NeoPa
Expert Mod 15k+
P: 31,494
On the Form. In the AfterUpdate Event Procedure of the control where the first field is managed.
Aug 22 '17 #2

P: 9
Thanks you I keep getting a syntax error
me.First_Follow_Up_Date_on_Email_7_days = DATEADD("d",7,Me.Second_follow_up_Date_on_Email)
Aug 22 '17 #3

NeoPa
Expert Mod 15k+
P: 31,494
I see no obvious syntax error. Perhaps it would make sense to post the exact error message and number along with the code of the whole procedure this error is thrown up within.

Please don't forget to use the [CODE] tags when posting code as that's a site requirement. Every posting window has a button to add them to any selected text for you.
Aug 22 '17 #4

P: 9
Hi Thanks for replying...
the error now reads;
The expression After Update you entered as the event property setting produced the following error; Invalid outside procedure.
*the expression may not result in the name of a macro, the name of a user-defined function, or [event procedure].
*there may have been an error evaluating the function, event or macro
Aug 22 '17 #5

PhilOfWalton
Expert 100+
P: 1,430
Pure Guess: I would have thought you would have updated the First Field and calculate the second from it, in which case the code should be

Expand|Select|Wrap|Line Numbers
  1. Me!SecondDate = DateAdd("d",7, Me!FirstDate)
  2.  
Sorry can't be bothered with your 35 letter field definitions. I'm a rotten typist.

Phil
Aug 22 '17 #6

NeoPa
Expert Mod 15k+
P: 31,494
Please refer back to my last post where I suggest you give the error message and number, along with the code of the whole procedure. One without the other adds very little to our understanding.

PS. The error message already posted indicates this is something quite different from a syntax error. Please try to be accurate with your information. That is critical. It avoids sending us off on wild-goose chases.
Aug 23 '17 #7

P: 9
Thank you , that was the issue I should have flipped the fields around.
Aug 23 '17 #8

Post your reply

Sign in to post your reply or Sign up for a free account.