Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

adding number to date in access form

Question posted by: buddyr (Member) on July 24th, 2008 01:08 AM
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
SonOf27's Avatar
SonOf27
Newbie
5 Posts
July 24th, 2008
02:36 AM
#2

Re: adding number to date in access form
Yes you can do that.

Reply
buddyr's Avatar
buddyr
Member
64 Posts
July 24th, 2008
03:54 AM
#3

Re: adding number to date in access form
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

Reply
SonOf27's Avatar
SonOf27
Newbie
5 Posts
July 24th, 2008
04:16 AM
#4

Re: adding number to date in access form
Quote:
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 

Reply
Delerna's Avatar
Delerna
Expert
562 Posts
July 24th, 2008
04:19 AM
#5

Re: adding number to date in access form
Using your naming convention
Expand|Select|Wrap|Line Numbers
  1. txtBox3 = DateAdd("m", txtBox , CDate(txtBox1))


a better way

Expand|Select|Wrap|Line Numbers
  1. txtResult = DateAdd("m", txtMonths , CDate(txtDte))

Reply
buddyr's Avatar
buddyr
Member
64 Posts
July 24th, 2008
10:04 AM
#6

Re: adding number to date in access form
yes that worked- thank you

Reply
missinglinq's Avatar
missinglinq
Moderator
2,456 Posts
July 24th, 2008
11:41 AM
#7

Re: adding number to date in access form
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)>

Reply
Delerna's Avatar
Delerna
Expert
562 Posts
July 24th, 2008
10:46 PM
#8

Re: adding number to date in access form
Quote:
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.

Reply
Reply
Not the answer you were looking for? Post your question . . .
190,076 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top Microsoft Access / VBA Forum Contributors