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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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 | |
|
|