Solved

Calculating Lead time

Posted on 2008-10-29
3
362 Views
Last Modified: 2012-05-05
I would like to learn how to calculate leadtime in VBA.  I have a txtbox that has a date.  Formatted as date.  I have a txtbox that has a number.  I have another box that is a calculation of the two.  Example

txtbx1
10/29/08

txtbx2
10

txtbx3
needs to equal 10 weeks in the future starting on 10/29/08.  

I have a work around adding another txtbox4.  which is calculated as =txtbx2*7.  Then
txtbx3 is calculated as =txtbx1*txtbx4.

There has to be another way.  This question is strictly for learning and not any emergency. It would be nice to learn a new trick

net
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 200 total points
ID: 22834749

  Take a look at DateAdd() in the on-line help, which is used to add a date plus a period.  It can be used anywhere an expression is valid (ie. a control source), and the arguments passed can be references to other controls on your form (ie.  Forms![<myFormName>]![<myControlName>].

HTH,
JimD.
0
 
LVL 4
ID: 22835347
BINGO!

=DateAdd("ww",[Text2],[Text1])

Thanks!

net
0
 
LVL 4

Author Closing Comment

by:get-ADuser -F ($_.Name -eq "Todd")
ID: 31511352
Great Help As Always!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question