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

Autofill Date by 14 days

4
Hello,

Very new to Access. I searched this forum but didn't even know where to start.

I come from a programming background so I'm not afraid of logic :)

What I want to do:

When someone enters a Date in, say, FieldDate, I want FieldDateDue to be 14 days later.


I have tried many things I thought would work but I'm stumped (even went so far as to read the Help ;) )

Can anyone help or point me in the right direction?

Thanks
Jan 12 '07 #1
9 2104
MMcCarthy
14,534 Expert Mod 8TB
Hello,

Very new to Access. I searched this forum but didn't even know where to start.

I come from a programming background so I'm not afraid of logic :)

What I want to do:

When someone enters a Date in, say, FieldDate, I want FieldDateDue to be 14 days later.


I have tried many things I thought would work but I'm stumped (even went so far as to read the Help ;) )

Can anyone help or point me in the right direction?

Thanks
You have to use a Data Entry Form. In the After Update event of FieldDate put the following VBA code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub FieldDate_AfterUpdate()
  2.  
  3.    Me.FieldDateDue = Me.FieldDate + 14
  4.  
  5. End Sub
  6.  
Mary
Jan 12 '07 #2
nyakki
4
You have to use a Data Entry Form. In the After Update event of FieldDate put the following VBA code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub FieldDate_AfterUpdate()
  2.  
  3.    Me.FieldDateDue = Me.FieldDate + 14
  4.  
  5. End Sub
  6.  
Mary
Thank you for the quick reply.

How do I find the Data Entry Form to enter the code into the appropriate Field?

Thanks
Jan 14 '07 #3
in design view right-click on the field date text field, select properties, select the events tab, click AfterUpdate, click the ellipsis to the right, choose code builder
Jan 14 '07 #4
nyakki
4
in design view right-click on the field date text field, select properties, select the events tab, click AfterUpdate, click the ellipsis to the right, choose code builder
Thank you for the reply. I really appreciate the help.

I did everything you said there. I don't get an events tab. I only have a "General" tab.

I've been in/out/up/down/sideways with the different fields, different points of entry, different types of test databases and still can't find the Events tab.

I've done every item in every menu option... nothing.

Here is my Properties window.



I am running Access 2003, if that makes any difference.

What am I doing wrong?

Thanks
Jan 14 '07 #5
NeoPa
32,556 Expert Mod 16PB
Good reply Nyaki.
From that I can see that you were not in the form, and more specifically, not in the TextBox control before you selected properties.
  1. Open the form in Design View.
  2. Click on the FieldDate TextBox.
  3. Select Properties (Alt-Enter).
  4. Scroll down to the After Update property and select [Event Procedure] from the list.
  5. Click on the ellipsis.
  6. You should now find yourself in the VBA window with the Event procedure started for you.
:)
Jan 14 '07 #6
nyakki
4
Good reply Nyaki.
From that I can see that you were not in the form, and more specifically, not in the TextBox control before you selected properties.
  1. Open the form in Design View.
  2. Click on the FieldDate TextBox.
  3. Select Properties (Alt-Enter).
  4. Scroll down to the After Update property and select [Event Procedure] from the list.
  5. Click on the ellipsis.
  6. You should now find yourself in the VBA window with the Event procedure started for you.
:)
I SEE THE LIGHT... :)

OK... This is what I was doing wrong (or otherwise put... this is where I got really confused...)...

1) I was still in the TABLE design. I hadn't worked my way to the FORM design because, well, I wasn't ready to enter info into the table yet (I was working on solving this problem).

2) I was going to what I thought was the TEXT BOX in Table Design mode (i.e. where you type in the name) and not the FORM Text Box where you actually put in the data.

3) Looking back on this thread AFTER I got this puppy working, I see where my misunderstanding of the lingo came up.

So, for those as new to Access as I am, here is my Totally Green Not Knowing Access At All Step-By-Step:

1) After creating the table OR as you are creating the table, save it.
2) Go to Forms in the Objects list. Open up your Database.
3) NOW Follow all of the steps given above :)

Thanks everyone for helping me out. I'm sure I'll have a few more questions in the future :)

nyakki
Jan 15 '07 #7
NeoPa
32,556 Expert Mod 16PB
When you posted the properties window you got, I could see what had happened.
This is a good illustration of where intelligent communication can get you where you need to go without the need for various posts backwards and forwards - one side trying to understand the other.
Jan 15 '07 #8
how would be done for business days only, no weekends or holidays
Aug 8 '08 #9
NeoPa
32,556 Expert Mod 16PB
how would be done for business days only, no weekends or holidays
You need to ask this question in a separate thread. We don't allow members to ask different (even if slightly related) questions in other threads.

I'm sure if you post this you will find someone willing to help you progress with it.

Welcome to Bytes!
Aug 9 '08 #10

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

Similar topics

2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
1
by: shortbackandsides.no | last post by:
I'm having a lot of difficulty trying to persuade the Google toolbar autofill to act consistently, for example ======================= <html><head> <title>autofill test</title> </head><body>...
0
by: David Portabella | last post by:
Hello, I am a doing a survey about Autofill Web Forms softwares. Usually, they all collect information of the user once during the set-up phase (user knowledge base). Then, when the user...
2
by: Andre Ranieri | last post by:
I'm retouching our corporate web site that, among other things, allows customers to log in and pay their invoices online. I noticed that on the checkout page, the credit card number textbox...
1
by: Wayne | last post by:
Hi all I'm trying to calculate the number of days (or workdays) between 2 given dates that do not include weekend days or public holidays (public holidays are user defined from a dbase, have a...
10
by: sandraz444 | last post by:
I have an expression in the query under my form to autofill the date under a certain condition but it wont write to the underlying table?? The date shows in the form but not the table. Does anyone...
1
by: Rissoman | last post by:
Hello, I have an issue were I have a zipcode textbox in an atlas ajax updatepanel. When you tab out of the zip textbox and the shipping is calculated. I know this works perfect! Then a user...
1
by: ArchMichael | last post by:
i need help again on calculating business days excluding holidays i have a field called assign date and i need to calculate 7 business days excluding holidays ( already have a table for holiday)...
12
by: klbrownie | last post by:
Hello, I am trying to get a date field to autofill based on the date of another date field. I want the autofilled date to be 30 days after the other date. For example, if the user has entered...
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
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
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,...
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.