Displaying a user entered date range in one form on a separate form

ravness

Registered User.
Local time
Today, 22:58
Joined
Aug 12, 2008
Messages
22
Problem
I've got a main form (frmChoosePeriod) which has a date selector option and a calendar set up so you can choose a start and end date.

Note - this start and end date is understandably temporary so when you close the form these chosen dates reset to blank again.

It's all coded and working well and when you do select the dates, there is a command button which on click takes you to a separate form (frmFinanceByDate) which displays totals for this date range.


Desired Solution

The end user now wants frmFinanceByDate to display the start and end date which have been selected in the previous form's date selector, in a simple form such as text.

So for example the form would show "Finance Data - From DD/MM/YYYY to DD/MM/YYYY"


Questions

Is this actually possible?

If so how would I go about it?

I presume it would be a nice bit of coding in the "OnClick" event procedure on the command button im using to open the new form, but i might be wrong.

Any help would be much appreciated.
 
Seems straight forward. If the button opens the new form and displays data from the first form, you are nearly there. Just add a couple of text boxes (text box 1 & 2) with the controls set to =Forms![first form]![start date] and ...[end date] Should be fine. Original form must remain open of course. To get it as a clean string you hide these two text boxes, then add another with the control set to ="Finance Data - From" &" "& [text box 1] & " "& "to" & " " & [text box 2]

Chris B
 
Last edited:
Problem
I've got a main form (frmChoosePeriod) which has a date selector option and a calendar set up so you can choose a start and end date.

Note - this start and end date is understandably temporary so when you close the form these chosen dates reset to blank again.

It's all coded and working well and when you do select the dates, there is a command button which on click takes you to a separate form (frmFinanceByDate) which displays totals for this date range.


Desired Solution

The end user now wants frmFinanceByDate to display the start and end date which have been selected in the previous form's date selector, in a simple form such as text.

So for example the form would show "Finance Data - From DD/MM/YYYY to DD/MM/YYYY"


Questions

Is this actually possible?

If so how would I go about it?

I presume it would be a nice bit of coding in the "OnClick" event procedure on the command button im using to open the new form, but i might be wrong.

Any help would be much appreciated.
Presumably the query that frmFinanceByDate is based on has the start and finish dates in it. Just use them for your title
 
thanks so much for your help and quick reply. i dont know why i didnt of that as its pretty simple.

i was looking for a solution which would still work if the user closed the original form...but hopefully as this form opens on top of the original one, i dont think they would go back and manually close the one before hand

do you know any solution just in case which would work even when the user closes the original form?
 
Presumably the query that frmFinanceByDate is based on has the start and finish dates in it. Just use them for your title

nope the query just has something like txtstartdate2 and txtenddate2 as part of an expression/code thing it doesnt actually display the dates.
 
You can set the second form to hide the first form when it opens (On Open event), then close the first form when it is closed (On Close event). This avoids the user closing the first form inappropriately.

Chris B
 

Users who are viewing this thread

Back
Top Bottom