Add future dates on button click

veg_racer

New member
Local time
Today, 21:38
Joined
Jan 2, 2014
Messages
9
Hi all, I am very new to Access and have virtually no experience with vb, I'm trying to build a customer database with some forms that enable myself and a couple of others to keep track of customer contact.
As you can see from the screenshot I have designed my form with 5 buttons at the bottom of the page with different future date values, I have made a field in my database called FollowUpBy and i would like to be able to click the buttons and have access take today's date plus the relevant follow up time-scale and insert that into this field. Also but on a separate note, I have the yes/no box for follow up required is there a way to make the buttons at the bottom and the date picker unavailable (perhaps shaded or crossed out) unless this box is checked?
 

Attachments

  • database pic.jpg
    database pic.jpg
    89.3 KB · Views: 76
take today's date plus the relevant follow up time-scale
Use the dateadd function to calculate the followup day -
Here is a link about dateadd

http://www.techonthenet.com/access/functions/date/dateadd.php

I would expect the code behind the (1 day) button would be something like

Code:
FollowupDate=DateAdd("d",1,Date())
I have the yes/no box for follow up required is there a way to make the buttons at the bottom and the date picker unavailable

for this, in your form current event put the following code - change names to suit

Code:
followupdate.showdatepicker=followuprequired
button1.enabled=followuprequired
button2.enabled=followuprequired
etc
 

Users who are viewing this thread

Back
Top Bottom