473,405 Members | 2,445 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,405 software developers and data experts.

Auto Calculate Calendar

I'm creating an Access Database 2003 for our Human Resource Dept. In the form, I will be adding a calendar wherein there will be date of hire, start date, etc. I need to be able to view the calendar to pick the date and I also need to auto calculate days. For example: if I start on 10/1/07, I need it to auto calculate on my next field +30, my next field will be +45 and my next field would be +90. What language do I use to do this and how do I get the calendar to appear so that I can choose a date for each field?
Oct 26 '07 #1
2 3162
beacon
579 512MB
I'm creating an Access Database 2003 for our Human Resource Dept. In the form, I will be adding a calendar wherein there will be date of hire, start date, etc. I need to be able to view the calendar to pick the date and I also need to auto calculate days. For example: if I start on 10/1/07, I need it to auto calculate on my next field +30, my next field will be +45 and my next field would be +90. What language do I use to do this and how do I get the calendar to appear so that I can choose a date for each field?
You need to use some VBA code. Are you familiar with this?
Oct 26 '07 #2
missinglinq
3,532 Expert 2GB
Place a calendar on your form and set its Visible Property to No. Then use this code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.   Me.YourCalendarName = Date
  3. End Sub
  4.  
  5. Private Sub YourCalendarName_Click()
  6.    Me.OriginalDateTextBox = YourCalendarName
  7.    Me.Date2 = DateAdd("d", 30, YourCalendarName)
  8.    Me.Date3 = DateAdd("d", 45, YourCalendarName)
  9.    Me.Date4 = DateAdd("d", 90, YourCalendarName)
  10.    OriginalDateTextBox.SetFocus
  11.    YourCalendarName.Visible = False
  12. End Sub
  13.  
  14. Private Sub OriginalDateTextBox_DblClick(Cancel As Integer)
  15.   YourCalendarName.Visible = True
  16. End Sub
  17.  
When the user Double Clicks on the text box that will hold the original date, the calendar pops up. Once a date is chosen, the calendar disappears and all fields are filled in.

Welcome to TheScripts!

Linq ;0)>
Oct 27 '07 #3

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

Similar topics

2
by: JP SIngh | last post by:
Hi All I need to calculate the number of working days between the two dates entered on an ASP page. I am not that great a coder in ASP and was wondering if someone can help. Basically the...
3
by: CrystalDBA | last post by:
I am using SQL Server 2000. I need to query my database for all the contracts that came in during a certain time frame (user is prompted for reportingperiodid). Table - Periods Fields -...
4
by: rudy | last post by:
I am currently using the Active X Calendar object in a form to select the dates. The problem I am having is when the month changes the calendar continues to display the previous month. How can I...
6
by: Jean | last post by:
Hi, I am using an Access 2000 front-end to an Oracle 9 backend. I want to write a query that returns all records that are not older than one year for Column "Status_30" (which is a Date). ...
7
by: Adrian | last post by:
I hit on this problem converting a VB.NET insurance application to C#. Age next birthday calculated from date of birth is often needed in insurance premium calculations. Originally done using...
2
by: john | last post by:
Is it true that if I split my access database in backend and frontend and I implement custom auto increment for the ID fields, that my database is ready to be used in a multi-user environment? I...
7
by: Sam | last post by:
Hi, I use C# in my ASP.NET projects. Here's what I need to do: I want to add x business days to a given date i.e. add 12 business days to today's date. What is the best, fastest and most...
37
by: mazwolfe | last post by:
I'm new here, so excuse me if my style is incorrect. Can anyone come up with a better method for this calculation? Code: int is_leap(int year) { switch (year % 19) { case 0: case 3: case 6:...
5
FishVal
by: FishVal | last post by:
IMHO, the following is not a how-to-do instruction to solve a particular problem but more a concept-proof stuff demonstrating possibilities of SQL. So, let us say the problem is to calculate...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.