473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

creating a workday calculator on access form

107 100+
Hello,
I have 3 fields dateout, datein, TurnAroundNumber(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.TurnAroundNumber)

I notice if the turnaroundnumber 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 4316
missinglinq
3,532 Expert 2GB
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 100+
thank you linc that works great
Aug 20 '08 #3
NeoPa
32,556 Expert Mod 16PB
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
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...
2
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. ...
0
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...
1
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...
4
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...
2
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. ...
3
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...
16
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...
6
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...
7
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...

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.