Date selection in Parameter

  • Thread starter Thread starter Mavis
  • Start date Start date
M

Mavis

Hi,

I had created a report from a query with 2 parameters to ask the user to
enter Start Date and End Date. I will like to have the calendar for the user
to select the date in the parameter rather than the user enter manually.

Thanks
 
Hi,

Beside the below, can i also check if the user enter any date. If they did
not enter anything, error message will prompt.

Thanks
 
Create a form that has the calendar controls on it and a command button.

Have the query refer to the calendar controls on the form you just created
instead of to [Start Date] and [End Date]. You do this using
Forms![NameOfForm]![NameOfControl]

In the Click event of the command button, put logic to ensure that they've
actually selected dates in both calendar controls. If they have, open the
report. If they haven't, display an error message.
 
Hi,

This is what i planned but when i click on the Command button, access still
always prompt me to enter the start date and end date again.
I had a form named "Form Date Range", 2 text field with calendar control
(startdate and enddate) and a Enter button. When i click on the OK buttom the
system always prompt me to enter the start date and end date again.
I had added in the command of >[Forms]![Form Date Range]![startdate] .....
can please help to advice? Did i do anything wrong?



Douglas J. Steele said:
Create a form that has the calendar controls on it and a command button.

Have the query refer to the calendar controls on the form you just created
instead of to [Start Date] and [End Date]. You do this using
Forms![NameOfForm]![NameOfControl]

In the Click event of the command button, put logic to ensure that they've
actually selected dates in both calendar controls. If they have, open the
report. If they haven't, display an error message.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Mavis said:
Hi,

I had created a report from a query with 2 parameters to ask the user to
enter Start Date and End Date. I will like to have the calendar for the
user
to select the date in the parameter rather than the user enter manually.

Thanks
 
Exactly what are you being asked for by the prompt: [Start Date], or
[Forms]![Form Date Range]![startdate]?

If the former, then you've still got a reference to [Start Date] somewhere
(did you perhaps refer to it as a ControlSource for a text box on your
report?).

If the latter, check that you typed the names of the form and form controls
correctly.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Mavis said:
Hi,

This is what i planned but when i click on the Command button, access
still
always prompt me to enter the start date and end date again.
I had a form named "Form Date Range", 2 text field with calendar control
(startdate and enddate) and a Enter button. When i click on the OK buttom
the
system always prompt me to enter the start date and end date again.
I had added in the command of >[Forms]![Form Date Range]![startdate] .....
can please help to advice? Did i do anything wrong?



Douglas J. Steele said:
Create a form that has the calendar controls on it and a command button.

Have the query refer to the calendar controls on the form you just
created
instead of to [Start Date] and [End Date]. You do this using
Forms![NameOfForm]![NameOfControl]

In the Click event of the command button, put logic to ensure that
they've
actually selected dates in both calendar controls. If they have, open the
report. If they haven't, display an error message.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Mavis said:
Hi,

I had created a report from a query with 2 parameters to ask the user
to
enter Start Date and End Date. I will like to have the calendar for the
user
to select the date in the parameter rather than the user enter
manually.

Thanks
 
Hi,

I found something very funny. When i open the Form Date Range and enter the
Start date and End Date, then i click on the query without clicking the "Ok"
button, the query can be opened without prompting me to enter the Start date
and end date again. But if i click on the "ok" button to open the report
which created by the query, it will prompt me to "Start Date (mm/dd/yyyy)".

This is very funny. Seem that i can open the query using the form but not
opening the report.


Douglas J. Steele said:
Exactly what are you being asked for by the prompt: [Start Date], or
[Forms]![Form Date Range]![startdate]?

If the former, then you've still got a reference to [Start Date] somewhere
(did you perhaps refer to it as a ControlSource for a text box on your
report?).

If the latter, check that you typed the names of the form and form controls
correctly.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Mavis said:
Hi,

This is what i planned but when i click on the Command button, access
still
always prompt me to enter the start date and end date again.
I had a form named "Form Date Range", 2 text field with calendar control
(startdate and enddate) and a Enter button. When i click on the OK buttom
the
system always prompt me to enter the start date and end date again.
I had added in the command of >[Forms]![Form Date Range]![startdate] .....
can please help to advice? Did i do anything wrong?



Douglas J. Steele said:
Create a form that has the calendar controls on it and a command button.

Have the query refer to the calendar controls on the form you just
created
instead of to [Start Date] and [End Date]. You do this using
Forms![NameOfForm]![NameOfControl]

In the Click event of the command button, put logic to ensure that
they've
actually selected dates in both calendar controls. If they have, open the
report. If they haven't, display an error message.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hi,

I had created a report from a query with 2 parameters to ask the user
to
enter Start Date and End Date. I will like to have the calendar for the
user
to select the date in the parameter rather than the user enter
manually.

Thanks
 
As I said, that implies that you've got a reference to [Start Date
(mm/dd/yyyy)] somewhere in your report.


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Mavis said:
Hi,

I found something very funny. When i open the Form Date Range and enter
the
Start date and End Date, then i click on the query without clicking the
"Ok"
button, the query can be opened without prompting me to enter the Start
date
and end date again. But if i click on the "ok" button to open the report
which created by the query, it will prompt me to "Start Date
(mm/dd/yyyy)".

This is very funny. Seem that i can open the query using the form but not
opening the report.


Douglas J. Steele said:
Exactly what are you being asked for by the prompt: [Start Date], or
[Forms]![Form Date Range]![startdate]?

If the former, then you've still got a reference to [Start Date]
somewhere
(did you perhaps refer to it as a ControlSource for a text box on your
report?).

If the latter, check that you typed the names of the form and form
controls
correctly.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Mavis said:
Hi,

This is what i planned but when i click on the Command button, access
still
always prompt me to enter the start date and end date again.
I had a form named "Form Date Range", 2 text field with calendar
control
(startdate and enddate) and a Enter button. When i click on the OK
buttom
the
system always prompt me to enter the start date and end date again.
I had added in the command of >[Forms]![Form Date Range]![startdate]
.....
can please help to advice? Did i do anything wrong?



:

Create a form that has the calendar controls on it and a command
button.

Have the query refer to the calendar controls on the form you just
created
instead of to [Start Date] and [End Date]. You do this using
Forms![NameOfForm]![NameOfControl]

In the Click event of the command button, put logic to ensure that
they've
actually selected dates in both calendar controls. If they have, open
the
report. If they haven't, display an error message.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hi,

I had created a report from a query with 2 parameters to ask the
user
to
enter Start Date and End Date. I will like to have the calendar for
the
user
to select the date in the parameter rather than the user enter
manually.

Thanks
 
Back
Top