A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Form help - please help!!



 
 
Thread Tools Display Modes
  #1  
Old November 30th, 2006, 03:57 PM posted to microsoft.public.access.gettingstarted
Andy Hull
external usenet poster
 
Posts: 212
Default Form help - please help!!

It makes perfect sense!

Go into design view in your form. Check the names of the boxes for the
handover date and snagging date. (Right click the box, choose properties, go
to "other" tab and "name" is the first property in the list).

They should be something like handover_date and snagging_date so I'll assume
that's what they are. If they don't have meaningful names then you can change
them.

Having checked the names, go to the properties of the handover_date box
again and choose the Event tab and click in the After Update box. Using the
drop down arrow to choose [Event Procedure] and then click on the 3 dots
(...) to the right of the box.

This will take you into the code and you will see something like

Private Sub handover_date_AfterUpdate()

End Sub

Type between these 2 lines so that it looks like

Private Sub handover_date_AfterUpdate()
If IsDate(Me.handover_date) Then
Me.snagging_date = DateAdd("m", 11, Me.handover_date)
End If
End Sub

(Make sure you use the exact names of the boxes on your form and not just
copy mine. When you are typing, as you type Me. access should list the valid
options and as you continue to type the box name you should be able to pick
it from the list which helps avoid typos).

Now on the Access menu click debug and then compile loaded modules, close
the code window & your form, saving as you go.

When you run the form now, as soon as you move off the handover_date box the
snagging_date box should automatically be filled in (or changed if it already
has a value).

Hope this makes sense & helps
Regards
Andy Hull

"Access beginner" wrote:

Hello

I have created an access database which contains a form. Part of the form
has three boxes that I want to contain dates.

The first date that I will enter is a handover date. The second date to be
entered is the snagging date (this has to be 11 months on from the handover
date). Is there a way so that when I enter the handover date, the second
date is automatically entered as the handover date + 11 months????

Hope this makes sense and someone can help

Thanks very much


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:35 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.