473,548 Members | 2,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access 2003: Setting up an automatic end date

5 New Member
Hi, I'm very new to Access...my company decided we need to have a database and I'm somehow trying to get my arms around this...

I'm using a 2003 version of Microsoft Access running on Windows Vista. I would like to know how I can set up an automatic end date. I'll explain:

I have a 'task' table which, among others, includes two fields: Active and End Date. The "Active" field is a simple Yes/No data type; when I check off the Active box, the task disappear from a related 'task' form. I would like Access to generate automatically an End Date every time I check off an Active box. Obviosuly, the end date should be current day/month/year and should appear in the "End Date" field.

How can I do this?

I've browsed the website looking for similar posts, but haven't found any. If I've missed it, it would be great if you could point me to that.

Many thanks for your help!
Mattia
Oct 31 '08 #1
5 2746
nico5038
3,080 Recognized Expert Specialist
I would change the Active Yes/No into a Start date, this will enable the calculation of the duration of a task in the future.

For both dates I would use a [<Now] button to put the current date into the field.
Just put in the OnClick event of the button:
Expand|Select|Wrap|Line Numbers
  1. Me.[End Date] = Date()
  2.  
Nic;o)
Oct 31 '08 #2
PianoMan64
374 Recognized Expert Contributor
Hi, I'm very new to Access...my company decided we need to have a database and I'm somehow trying to get my arms around this...

I'm using a 2003 version of Microsoft Access running on Windows Vista. I would like to know how I can set up an automatic end date. I'll explain:

I have a 'task' table which, among others, includes two fields: Active and End Date. The "Active" field is a simple Yes/No data type; when I check off the Active box, the task disappear from a related 'task' form. I would like Access to generate automatically an End Date every time I check off an Active box. Obviosuly, the end date should be current day/month/year and should appear in the "End Date" field.

How can I do this?

I've browsed the website looking for similar posts, but haven't found any. If I've missed it, it would be great if you could point me to that.

Many thanks for your help!
Mattia
Mattia,

Simply put, you'd have to set the value for the field EndDate when the value of Active is set to true.

I'm assuming first of all that you have this table displayed in a form, and you're not updating the table directly in the table view?

I'm also assuming that if you are updating the information, that you're using a continuous form, or a form that has the "Active" field in it, and may or may not have the "EndDate" field on that form.

If either of those are true then here's what you need to do:

1. Go into design mode of the form
2. right-click on the CheckBox and select Properties.
3. Locate the "On Change" Event from the list of the available events
3. Then click on the ... button that is on the far right of Properties window, and select Code Builder.
4. You will then see a empty subroutine for "Active_OnChang e" Event.
5. In the middle of that copy and paste the following code:
Expand|Select|Wrap|Line Numbers
  1.  
  2.           If me.active = True Then
  3.                me.EndDate = Date
  4.           Else
  5.                me.EndDate = Null
  6.           End If
  7.  
  8.  
Oct 31 '08 #3
mattia
5 New Member
PianoMan64,

Thanks, your answer is very clear. However, I'm such a begineer and I have a question: in the "Event" tab of the properties I have various "on change" items:
On Data Change, on Data Set Change, On PivotTable Change, On Selection Change, on View Change...which one is the one you are referring to?

Also, just to make sure we are on the same page, once I implement the new code, where will the End Date appear? On the Table? Not on the Form, since when the task is completed (i.e.: the Active box is checked off) the task disappear from the Form...

Many thanks!
Mattia
Oct 31 '08 #4
PianoMan64
374 Recognized Expert Contributor
PianoMan64,

Thanks, your answer is very clear. However, I'm such a begineer and I have a question: in the "Event" tab of the properties I have various "on change" items:
On Data Change, on Data Set Change, On PivotTable Change, On Selection Change, on View Change...which one is the one you are referring to?

Also, just to make sure we are on the same page, once I implement the new code, where will the End Date appear? On the Table? Not on the Form, since when the task is completed (i.e.: the Active box is checked off) the task disappear from the Form...

Many thanks!
Mattia
Hey Mattia,

The reason that you have all those choices is because when you right-clicked, you right-clicked on the form and not the check box control. If you will right-click on the check box control instead of some place on the form, then you will see the only change option that I'm speaking of.

That should clear up any confusion that you're having on the form.

You'll also notice that in the upper-left hand corner of the properties window, you'll see the name's of the controls that are on the current form, and well as other control names like (FORM, DETAIL) and maybe, FORMHEADER, FORMFOOTER, PAGEHEADERSECTI ON, PAGEFOOTERSECTI ON). These are for controls that are on the form that have events associated with them as well.

Since we're dealing with only the check box control, you need to make sure that when you right-click, that it is on the check box itself or use the pull-down menu in the properties window to select the name of the check box control.

I hope that helps,

Joe P.
Nov 1 '08 #5
mattia
5 New Member
Thanks! I'll try this out!

M
Nov 4 '08 #6

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

Similar topics

3
5701
by: Ian | last post by:
The beginning of my assembly that I am getting the access error from looks like this. ********************************* Imports System.EnterpriseServices Imports System Imports System.Collections Imports System.Configuration Imports System.Data Imports System.Data.Common Imports System.Reflection
6
4721
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance
64
5159
by: John | last post by:
Hi What future does access have after the release of vs 2005/sql 2005? MS doesn't seem to have done anything major with access lately and presumably hoping that everyone migrates to vs/sql. Any comments? Thanks
4
3588
by: TrinityPete | last post by:
Hi all, We have a web application that uses web services for data access and retrieval. The web app and web services reside under IIS on the same server(WIN2003). The virtual directories have been set for windows authentication and both the ASP web application and the web services are using windows authentication with impersonation of the...
52
9926
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server 2005, and, since he already has licenses for Office Pro 2002, he wants to upgrade to that. I've been saying that we need to upgrade to Access...
5
3148
by: Amogh | last post by:
Hi, My question is related to setting freed pointers to NULL. After freeing a pointer: 1) Should the freeing routine also be responsible for setting the pointer to null? 2) Or, should the client/user code be responsible for doing it? On what basis should a decision be made favouring either case ?
3
3843
by: Sheldon | last post by:
I have the following query expression - Like Format((!!)) & "/*/" & (! !) which would translate to e.g. 04/*/2007 if someone is running a report for last month. The above expression is part of a Where clause for a date field. It works fine in Access 2000 and pulls out the appropriate # of records but in Access 2003, this expression...
9
4479
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd like to know is the stability, speed & ease of use of both the products. I believe Access 2007 has a new file format too and that it may be...
2
2917
by: | last post by:
Hi all, I have an asp.net 2.0 website that accesses a locally hosted web service. This works fine on servers that are connected to our network. However, I am having a problem with a laptop server that I have built. The code that tries to connect to the web service breaks if the laptop is not within our network. Further debugging has...
0
7518
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...
0
7711
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7954
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7805
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...
0
6039
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...
1
5367
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3478
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1932
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
1
1054
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.