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

adding number to date in access form

100+
P: 107
Hello,
txtbox one has a date.
txtbox two has a number. number is number of days)
txtbox three is empty.
I have alot more going on but this is my question:
can I add txtbox1 + txtbox2 and show answer in txtbox3?
example:
txtbox1 - 1/2/2008
txtbox - 2
txtbox3 -1/4/2008
thank you
Jul 24 '08 #1
Share this Question
Share on Google+
7 Replies


P: 11
Yes you can do that.
Jul 24 '08 #2

100+
P: 107
not sure how to do it
do i go into properties of txtbox in control source or do I go into vb code.
Thank you
Jul 24 '08 #3

P: 11
not sure how to do it
do i go into properties of txtbox in control source or do I go into vb code.
Thank you
I guess it depends on what your doing. You could trigger some vb code similar to the following from the after update of the two text boxes to populate the txtbox3 with the answer.

Expand|Select|Wrap|Line Numbers
  1.  me.txtbox3 = me.txtbox1 + me.txtbox2 
Jul 24 '08 #4

Delerna
Expert 100+
P: 1,134
Using your naming convention
Expand|Select|Wrap|Line Numbers
  1. txtBox3 = DateAdd("m", txtBox , CDate(txtBox1))
  2.  
a better way

Expand|Select|Wrap|Line Numbers
  1. txtResult = DateAdd("m", txtMonths , CDate(txtDte))
  2.  
Jul 24 '08 #5

100+
P: 107
yes that worked- thank you
Jul 24 '08 #6

missinglinq
Expert 2.5K+
P: 3,532
I've been doing this since the '90s! They keep telling me Date + 3 won't work in the future, but it still does!

Linq ;0)>
Jul 24 '08 #7

Delerna
Expert 100+
P: 1,134
I've been doing this since the '90s! They keep telling me Date + 3 won't work in the future, but it still does!

Linq ;0)>
Yes, and about that time they recommended not using DoCMD for the same reason. But its still there.I don't know about the latest version though.
Jul 24 '08 #8

Post your reply

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