473,659 Members | 3,117 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

creating a workday calculator on access form

107 New Member
Hello,
I have 3 fields dateout, datein, TurnAroundNumbe r(number).
I used this code in module:
Expand|Select|Wrap|Line Numbers
  1. Function GetDateOut(dDate As Date, Span As Integer) As Date
  2. Dim j As Integer, i As Integer, dtStart
  3. dtStart = dDate
  4. For j = 1 To Span
  5.     dtStart = dtStart + 1
  6.     Do While Weekday(dtStart) = 1 Or Weekday(dtStart) = 7 
  7.         dtStart = dtStart + 1
  8.         i = i + 1
  9.     Loop
  10. Next
  11. GetDateOut = DateAdd("d", i + Span, dDate)
  12. End Function
in a calculate command button I made the call:
me.[dateout]=getDateOut(me. dateIn, me.TurnAroundNu mber)

I notice if the turnaroundnumbe r textbox is empty I get a null error.
Can I stop that from happening?
and can I place this in a subform and not adversely effect other objects and subforms.
Thank you
Aug 20 '08 #1
3 4323
missinglinq
3,532 Recognized Expert Specialist
Something like this

Expand|Select|Wrap|Line Numbers
  1. If Not IsNull(me.TurnAroundNumber) Then
  2.   me.[dateout]=getDateOut(me.dateIn, me.TurnAroundNumber)
  3. Else
  4.   Msgbox "This Computation Cannot Be Run When Turn Around Number Is Blank!"
  5. End If
Linq ;0)>
Aug 20 '08 #2
buddyr
107 New Member
thank you linc that works great
Aug 20 '08 #3
NeoPa
32,568 Recognized Expert Moderator MVP
As a full member now, you should know that we expect your code to be posted in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use the tags in future.

ADMIN.
Aug 20 '08 #4

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

Similar topics

9
3263
by: Frances | last post by:
Hi All, * PREMISE * I'm creating an Access form with 150 items subdivided into 20 categories. Multiple categories (and items) can be selected so my user wants checkboxes. All of the options need to be visible at the same time so no dropdowns (combo boxes) and no scrolling lists (list boxes). I will use tabbed sheets with logically grouped categories (and their respective items).
2
11692
by: Josh Strickland | last post by:
I am attempting to create an Access database which uses forms to enter data. The issue I am having is returning the query results from the Stored Procedure back in to the Access Form. tCetecM1CUST (SQL Table that contains the Customer Information) tAccountingDetail (SQL Table that contains the information in the form) frmAccountingEntry (Access form used to enter data) spGetCustomerInformation (Stored Procedure which returns data using...
0
1184
by: Bon | last post by:
Hello all I need to paste two pie charts in the MS Access 2000 Form. Actually, it is one of the Form in Tab folder. This is used to give customers a quick visual summary of how many do they buy for each product. I created a pie chart in MS Excel 2000. Data source are from MS Access 2000 database. After the charts are created successfully, I want to paste them into Access Form. But, I don't want the excel workbook run everytime when...
1
2083
by: john saul | last post by:
Hello All, I am not extremely new to Access but need help to hopefully a simple question. I am creating a project quote form that will ask customers questions and retreive pricing due to the answers they submit.This form pulls in precalculated values and preforms other calculations as the cusomer moves down the list. What i need is to beable to save the feild values of this entire form so i can go back later and reveiw old quotes that will...
4
9515
by: KPOJonesECC | last post by:
Hello, I am in the middle of an access database projet but are struggerling with a couple of things. I dont expect anyone to solve the problem for me, but would really appreciate a pointer in the right direction as I am starting to struggle in terms of direction on this. Problem no1: I am currently trying to build an interactive calculator in a access form. Im making ok progress but have a couple of things I cant work out how to...
2
1402
by: Lewe22 | last post by:
I am creating a small Access db which performs a series of updates to a SQL db. The Access db consists of a ‘Main Form’, from which the user can run each update via a series of command buttons. Each update has been written as a SQL pass-through query. Example Update: UPDATE unit_instance_occurrences uio SET fes_active_places =
3
2494
by: teephish | last post by:
Hello, I'm currently in the process of creating a small access database and I'm having some problems with creating a customized search. I would like the user to be able to search a record by last name or street address. I have two questions: 1. I am currently using the built in "find and replace" dialog box, which works fine for the most part, but I need to be able to add some code to make the search more customized. I'm new to access, so...
16
11804
by: John | last post by:
I am looking for VBA code that will work with Access 2003 to enable dragging and dropping a file/folder name from Windows XP Explorer into an Access form's text box. This is a common functionality that most Windows programs have, so I'm suprised it's not easier to implement in Access/VBA. Through Google, I found two VB6 examples and one VBA example on the Access Web written by Dev Ashish. The VB6 examples used loops to keep checking...
6
29057
by: hayadooen | last post by:
Hi all, Very new to this forum. Searched for relative postings but found none. Question: Does anyone know of any application that could convert/import scanned docs (PDFs) into access database (specified fields)? I constantly deal with paper works from clients like purchase orders, etc. and data entry into access is very time-consuming and costly.
7
13161
by: kpresidente | last post by:
Hello all, I'm trying to transfer the value of a control on an Access form to an Excel worksheet using VBA. The Access form is a single form with all the controls disabled, so that data is "read only." I have a button on the form which opens the Excel worksheet, which then basically serves as the input form for the Access database. What I need is to somehow get the primary key (EstimateID) of the current record on the Access form...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8528
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2752
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.