Enter a date, add days from drop down, autofill another date box

TT13

New member
Local time
Today, 16:18
Joined
Nov 21, 2003
Messages
6
I have a form where the user enters a date into a field (box 1). Next they select a time frame in days from a drop down (box 2). What I want is for Access to take the date entered from box 1 add the number of days selected from box 2 and place the new (later) date into box 3. From there I can run simple queries. It's for a small data base to track the recall of pacemaker patients.

I enter their appointmet (today) date 1st box and then select whether they should return in 30, 90, or 180 days for a follow up 2nd box. When I choose the interval I want a 3rd box to automatically show their next appointment due date.

I am obviously not an Access expert and I think this should be simple. But 3 cups of coffee and 2 handfuls of my own hair have taken me further from a solution. THANK YOU for looking!!
 
OK I have made a little progress. I built a que that takes the date from box1 and adds the number of days selected from box 2 and puts it into a column Expr1 of my que. This gives me an accurate future date calculation.

My problem now is getting it to display on my form. I tried to use a text box with a control source =([que_futureDate]![Expr1]) and
=("[Expr1]","[que_futureDate]") but I don't get anything other than name?

Any ideas? HELP Please
 
have a look at the sample.
 

Attachments

Yes THANKS! Your sample works but I am having a little trouble taking it apart. Can't seem to find where NextApp comes from. Saw a MySQL something statement but can't seem to get it to show again.

This may end up being a little too much for my brain but I have to thank you for helping. But I'm going to give it a good try! Slick solutions never cease to amaze me and depress me (so much to learn, so little time). Thanks Tom
 
To view the datasource of the current sample, open the form in design view, go to properties (Alt+Enter] click Data, look for Record Source click the three ... and you will see "Query Builder".

Expand the column (4th from left) that reads:
Code:
NextApp: DateAdd("d",[AddDays],[AppDate])
This is how NextApp get its data, I have used the DateAdd function.

Have a look in Help under "DateAdd Funciton"

If you changed the "d" to "m" then the DateAdd function would add Months instead of Days.
 
Wow I feel like the guy who returned a chain-saw to the store because he said " this thing doesn't cut anymore wood than my old handsaw". When the salesman pulled the cord and started it up, the man jumped back and yelled "hay, what's all that noise"?

THANKS so much! Great job! Tom
 
Hello,

Apologies for bumping this, but it helped me solve my problem up to a point!!
The code returns 'name?!' in my text box.
I think it might be related to the fact that i'm trying to store the newly generated date in a field in my main table. I need this date available so i can run a query based on items to be tested on that generated date.
Can anybody help?

cheers

swifty
 

Users who are viewing this thread

Back
Top Bottom