Solved

Calculating Lead time

Posted on 2008-10-29
3
328 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
  • 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

705 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now