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
Solved

Calculating Lead time

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
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…
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

856 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