Msg Box question

G

Guest

I have several reports that are run by queries. Most of these queries have
date range parameters that must be entered by the operator. I have one query
that I ask only for a week ending date. This is driving mgmt nuts because
they are used to entering a beginning date first, followed by the ending
date. I hard wire the beginning date myself. How can I get a msg box to pop
up to tell people what my hardwired date is? Ideas?
 
D

Douglas J. Steele

I believe you're describing pop-up Parameter Input Boxes, not message boxes.

One option is to use a form to enter the parameter values rather than simply
having dialog boxes pop up. In that way, you can put as much or as little in
the way of instructions as you like.
 
G

Guest

I haven't ever used a form that way but I like the sound of it. Let me see
if I get it. I would design a form and on this form would be a textbox for
end date and I would hard wire the date I want to always use as begin date
also in a textbox. After client enters data, somehow the query is launched
(how would that happen?). Is that close?
 
D

Douglas J. Steele

Close. You need to change your queries so that rather than having [Enter
Start Date:] as a parameter, they refer to the control on the form
(Forms![NameOfForm]![NameOfControl]). You'd add a command button on the form
that invokes the OpenReport method.
 
G

Guest

OK. I have a query that has the following as the criteria.
([Forms]![Data Entry Driver]![Text1]) where Text1 is the name of the
control. It is a simple textbox. Then I also would like the form Data Entry
Driver to have a combo box on it to select a supervisor & have that value
passed to the query as well. It does not recognize either the textbox or the
combo box.
([Forms]![Data Entry Driver]![Combo3]) is what I have as the criteria to get
the supervisor. Ideas?

Douglas J. Steele said:
Close. You need to change your queries so that rather than having [Enter
Start Date:] as a parameter, they refer to the control on the form
(Forms![NameOfForm]![NameOfControl]). You'd add a command button on the form
that invokes the OpenReport method.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Bunky said:
I haven't ever used a form that way but I like the sound of it. Let me
see
if I get it. I would design a form and on this form would be a textbox
for
end date and I would hard wire the date I want to always use as begin date
also in a textbox. After client enters data, somehow the query is
launched
(how would that happen?). Is that close?
 
D

Douglas J. Steele

Is the form open when you run the query? Access will not open it for you.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Bunky said:
OK. I have a query that has the following as the criteria.
([Forms]![Data Entry Driver]![Text1]) where Text1 is the name of the
control. It is a simple textbox. Then I also would like the form Data
Entry
Driver to have a combo box on it to select a supervisor & have that value
passed to the query as well. It does not recognize either the textbox or
the
combo box.
([Forms]![Data Entry Driver]![Combo3]) is what I have as the criteria to
get
the supervisor. Ideas?

Douglas J. Steele said:
Close. You need to change your queries so that rather than having [Enter
Start Date:] as a parameter, they refer to the control on the form
(Forms![NameOfForm]![NameOfControl]). You'd add a command button on the
form
that invokes the OpenReport method.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Bunky said:
I haven't ever used a form that way but I like the sound of it. Let me
see
if I get it. I would design a form and on this form would be a textbox
for
end date and I would hard wire the date I want to always use as begin
date
also in a textbox. After client enters data, somehow the query is
launched
(how would that happen?). Is that close?
:

I believe you're describing pop-up Parameter Input Boxes, not message
boxes.

One option is to use a form to enter the parameter values rather than
simply
having dialog boxes pop up. In that way, you can put as much or as
little
in
the way of instructions as you like.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I have several reports that are run by queries. Most of these
queries
have
date range parameters that must be entered by the operator. I have
one
query
that I ask only for a week ending date. This is driving mgmt nuts
because
they are used to entering a beginning date first, followed by the
ending
date. I hard wire the beginning date myself. How can I get a msg
box
to
pop
up to tell people what my hardwired date is? Ideas?
 
G

Guest

Yes, I punch a command button on the open form after I fill in the two entry
boxes; one pull down and one entry.

Douglas J. Steele said:
Is the form open when you run the query? Access will not open it for you.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Bunky said:
OK. I have a query that has the following as the criteria.
([Forms]![Data Entry Driver]![Text1]) where Text1 is the name of the
control. It is a simple textbox. Then I also would like the form Data
Entry
Driver to have a combo box on it to select a supervisor & have that value
passed to the query as well. It does not recognize either the textbox or
the
combo box.
([Forms]![Data Entry Driver]![Combo3]) is what I have as the criteria to
get
the supervisor. Ideas?

Douglas J. Steele said:
Close. You need to change your queries so that rather than having [Enter
Start Date:] as a parameter, they refer to the control on the form
(Forms![NameOfForm]![NameOfControl]). You'd add a command button on the
form
that invokes the OpenReport method.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)



I haven't ever used a form that way but I like the sound of it. Let me
see
if I get it. I would design a form and on this form would be a textbox
for
end date and I would hard wire the date I want to always use as begin
date
also in a textbox. After client enters data, somehow the query is
launched
(how would that happen?). Is that close?
:

I believe you're describing pop-up Parameter Input Boxes, not message
boxes.

One option is to use a form to enter the parameter values rather than
simply
having dialog boxes pop up. In that way, you can put as much or as
little
in
the way of instructions as you like.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I have several reports that are run by queries. Most of these
queries
have
date range parameters that must be entered by the operator. I have
one
query
that I ask only for a week ending date. This is driving mgmt nuts
because
they are used to entering a beginning date first, followed by the
ending
date. I hard wire the beginning date myself. How can I get a msg
box
to
pop
up to tell people what my hardwired date is? Ideas?
 
D

Douglas J. Steele

When you say it doesn't recognize the two controls, what do you mean? Are
you saying that it still pops up a prompt rather than accepting what you've
got in the controls, or are you saying that it's returning everything?

What does the SQL of your query look like now?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Bunky said:
Yes, I punch a command button on the open form after I fill in the two
entry
boxes; one pull down and one entry.

Douglas J. Steele said:
Is the form open when you run the query? Access will not open it for you.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Bunky said:
OK. I have a query that has the following as the criteria.
([Forms]![Data Entry Driver]![Text1]) where Text1 is the name of the
control. It is a simple textbox. Then I also would like the form Data
Entry
Driver to have a combo box on it to select a supervisor & have that
value
passed to the query as well. It does not recognize either the textbox
or
the
combo box.
([Forms]![Data Entry Driver]![Combo3]) is what I have as the criteria
to
get
the supervisor. Ideas?

:

Close. You need to change your queries so that rather than having
[Enter
Start Date:] as a parameter, they refer to the control on the form
(Forms![NameOfForm]![NameOfControl]). You'd add a command button on
the
form
that invokes the OpenReport method.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)



I haven't ever used a form that way but I like the sound of it. Let
me
see
if I get it. I would design a form and on this form would be a
textbox
for
end date and I would hard wire the date I want to always use as
begin
date
also in a textbox. After client enters data, somehow the query is
launched
(how would that happen?). Is that close?
:

I believe you're describing pop-up Parameter Input Boxes, not
message
boxes.

One option is to use a form to enter the parameter values rather
than
simply
having dialog boxes pop up. In that way, you can put as much or as
little
in
the way of instructions as you like.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I have several reports that are run by queries. Most of these
queries
have
date range parameters that must be entered by the operator. I
have
one
query
that I ask only for a week ending date. This is driving mgmt
nuts
because
they are used to entering a beginning date first, followed by the
ending
date. I hard wire the beginning date myself. How can I get a
msg
box
to
pop
up to tell people what my hardwired date is? Ideas?
 
G

Guest

It does not ask for a prompt; justs gives me nothing but a report heading.

SQL -
SELECT Staff.Specialist, Sum(Attendance.Points) AS SumOfPoints,
Attendance.[Attend-Date], Max(Attendance.[Attend-Date]) AS [MaxOfAttend-Date]
FROM Staff LEFT JOIN Attendance ON Staff.Specialist = Attendance.Specialist
WHERE (((Staff.Supervisor)=([Forms]![Data Entry Driver]![Combo3])))
GROUP BY Staff.Specialist, Attendance.[Attend-Date]
HAVING (((Attendance.[Attend-Date])=([Forms]![Data Entry Driver]![Text1])));

Douglas J. Steele said:
When you say it doesn't recognize the two controls, what do you mean? Are
you saying that it still pops up a prompt rather than accepting what you've
got in the controls, or are you saying that it's returning everything?

What does the SQL of your query look like now?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Bunky said:
Yes, I punch a command button on the open form after I fill in the two
entry
boxes; one pull down and one entry.

Douglas J. Steele said:
Is the form open when you run the query? Access will not open it for you.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


OK. I have a query that has the following as the criteria.
([Forms]![Data Entry Driver]![Text1]) where Text1 is the name of the
control. It is a simple textbox. Then I also would like the form Data
Entry
Driver to have a combo box on it to select a supervisor & have that
value
passed to the query as well. It does not recognize either the textbox
or
the
combo box.
([Forms]![Data Entry Driver]![Combo3]) is what I have as the criteria
to
get
the supervisor. Ideas?

:

Close. You need to change your queries so that rather than having
[Enter
Start Date:] as a parameter, they refer to the control on the form
(Forms![NameOfForm]![NameOfControl]). You'd add a command button on
the
form
that invokes the OpenReport method.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)



I haven't ever used a form that way but I like the sound of it. Let
me
see
if I get it. I would design a form and on this form would be a
textbox
for
end date and I would hard wire the date I want to always use as
begin
date
also in a textbox. After client enters data, somehow the query is
launched
(how would that happen?). Is that close?
:

I believe you're describing pop-up Parameter Input Boxes, not
message
boxes.

One option is to use a form to enter the parameter values rather
than
simply
having dialog boxes pop up. In that way, you can put as much or as
little
in
the way of instructions as you like.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I have several reports that are run by queries. Most of these
queries
have
date range parameters that must be entered by the operator. I
have
one
query
that I ask only for a week ending date. This is driving mgmt
nuts
because
they are used to entering a beginning date first, followed by the
ending
date. I hard wire the beginning date myself. How can I get a
msg
box
to
pop
up to tell people what my hardwired date is? Ideas?
 
D

Douglas J. Steele

What's in Attend-Date: a valid date, or a date/time (because it was
populated using the Now function)? If it's a date/time and all you're
entering is a date, that's likely a problem. Try

HAVING DateValue(Attendance.[Attend-Date])=[Forms]![Data Entry
Driver]![Text1]

instead, although realistically it would be more efficient to combine both
of those into the Where clause:

WHERE Staff.Supervisor=[Forms]![Data Entry Driver]![Combo3]
AND DateValue(Attendance.[Attend-Date])=[Forms]![Data Entry Driver]![Text1]

If that doesn't solve the problem, while the form is open and populated,
open the Immediate Window (Ctrl-G)

Type

?[Forms]![Data Entry Driver]![Combo3]

(complete with the question mark) and hit Enter. What's returned? Does it
correspond to what you expect to find in the Supervisor field?

For that matter, what are you typing into Text1?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Bunky said:
It does not ask for a prompt; justs gives me nothing but a report heading.

SQL -
SELECT Staff.Specialist, Sum(Attendance.Points) AS SumOfPoints,
Attendance.[Attend-Date], Max(Attendance.[Attend-Date]) AS
[MaxOfAttend-Date]
FROM Staff LEFT JOIN Attendance ON Staff.Specialist =
Attendance.Specialist
WHERE (((Staff.Supervisor)=([Forms]![Data Entry Driver]![Combo3])))
GROUP BY Staff.Specialist, Attendance.[Attend-Date]
HAVING (((Attendance.[Attend-Date])=([Forms]![Data Entry
Driver]![Text1])));

Douglas J. Steele said:
When you say it doesn't recognize the two controls, what do you mean? Are
you saying that it still pops up a prompt rather than accepting what
you've
got in the controls, or are you saying that it's returning everything?

What does the SQL of your query look like now?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Bunky said:
Yes, I punch a command button on the open form after I fill in the two
entry
boxes; one pull down and one entry.

:

Is the form open when you run the query? Access will not open it for
you.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


OK. I have a query that has the following as the criteria.
([Forms]![Data Entry Driver]![Text1]) where Text1 is the name of the
control. It is a simple textbox. Then I also would like the form
Data
Entry
Driver to have a combo box on it to select a supervisor & have that
value
passed to the query as well. It does not recognize either the
textbox
or
the
combo box.
([Forms]![Data Entry Driver]![Combo3]) is what I have as the
criteria
to
get
the supervisor. Ideas?

:

Close. You need to change your queries so that rather than having
[Enter
Start Date:] as a parameter, they refer to the control on the form
(Forms![NameOfForm]![NameOfControl]). You'd add a command button on
the
form
that invokes the OpenReport method.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)



I haven't ever used a form that way but I like the sound of it.
Let
me
see
if I get it. I would design a form and on this form would be a
textbox
for
end date and I would hard wire the date I want to always use as
begin
date
also in a textbox. After client enters data, somehow the query
is
launched
(how would that happen?). Is that close?
:

I believe you're describing pop-up Parameter Input Boxes, not
message
boxes.

One option is to use a form to enter the parameter values rather
than
simply
having dialog boxes pop up. In that way, you can put as much or
as
little
in
the way of instructions as you like.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I have several reports that are run by queries. Most of these
queries
have
date range parameters that must be entered by the operator. I
have
one
query
that I ask only for a week ending date. This is driving mgmt
nuts
because
they are used to entering a beginning date first, followed by
the
ending
date. I hard wire the beginning date myself. How can I get a
msg
box
to
pop
up to tell people what my hardwired date is? Ideas?
 
G

Guest

Attend-Date is a date/time with a format of short date and has an input of
Date().

I entered the HAVING - - - - on the query and it gave me a syntax
error(rats). Checked closely and rekeyed - still syntax error. Then I took
all of criteria out and went to SQL view and typed WHERE - - - . When I went
to the Data Entry Driver form, I entered 10/31/07 in text1 and pulled down a
name for Combo3. Then I clicked the command button. It showed me the report
but with no data. I went back to the open form and keyed Ctrl-G, entered the
line you gave me and it shows the values entered on the form in both cases.
I copied the query and hardwired date and supervisor and report looks fine.
I am typing 10/31/07 in text1. Ideas?

Douglas J. Steele said:
What's in Attend-Date: a valid date, or a date/time (because it was
populated using the Now function)? If it's a date/time and all you're
entering is a date, that's likely a problem. Try

HAVING DateValue(Attendance.[Attend-Date])=[Forms]![Data Entry
Driver]![Text1]

instead, although realistically it would be more efficient to combine both
of those into the Where clause:

WHERE Staff.Supervisor=[Forms]![Data Entry Driver]![Combo3]
AND DateValue(Attendance.[Attend-Date])=[Forms]![Data Entry Driver]![Text1]

If that doesn't solve the problem, while the form is open and populated,
open the Immediate Window (Ctrl-G)

Type

?[Forms]![Data Entry Driver]![Combo3]

(complete with the question mark) and hit Enter. What's returned? Does it
correspond to what you expect to find in the Supervisor field?

For that matter, what are you typing into Text1?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Bunky said:
It does not ask for a prompt; justs gives me nothing but a report heading.

SQL -
SELECT Staff.Specialist, Sum(Attendance.Points) AS SumOfPoints,
Attendance.[Attend-Date], Max(Attendance.[Attend-Date]) AS
[MaxOfAttend-Date]
FROM Staff LEFT JOIN Attendance ON Staff.Specialist =
Attendance.Specialist
WHERE (((Staff.Supervisor)=([Forms]![Data Entry Driver]![Combo3])))
GROUP BY Staff.Specialist, Attendance.[Attend-Date]
HAVING (((Attendance.[Attend-Date])=([Forms]![Data Entry
Driver]![Text1])));

Douglas J. Steele said:
When you say it doesn't recognize the two controls, what do you mean? Are
you saying that it still pops up a prompt rather than accepting what
you've
got in the controls, or are you saying that it's returning everything?

What does the SQL of your query look like now?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Yes, I punch a command button on the open form after I fill in the two
entry
boxes; one pull down and one entry.

:

Is the form open when you run the query? Access will not open it for
you.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


OK. I have a query that has the following as the criteria.
([Forms]![Data Entry Driver]![Text1]) where Text1 is the name of the
control. It is a simple textbox. Then I also would like the form
Data
Entry
Driver to have a combo box on it to select a supervisor & have that
value
passed to the query as well. It does not recognize either the
textbox
or
the
combo box.
([Forms]![Data Entry Driver]![Combo3]) is what I have as the
criteria
to
get
the supervisor. Ideas?

:

Close. You need to change your queries so that rather than having
[Enter
Start Date:] as a parameter, they refer to the control on the form
(Forms![NameOfForm]![NameOfControl]). You'd add a command button on
the
form
that invokes the OpenReport method.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)



I haven't ever used a form that way but I like the sound of it.
Let
me
see
if I get it. I would design a form and on this form would be a
textbox
for
end date and I would hard wire the date I want to always use as
begin
date
also in a textbox. After client enters data, somehow the query
is
launched
(how would that happen?). Is that close?
:

I believe you're describing pop-up Parameter Input Boxes, not
message
boxes.

One option is to use a form to enter the parameter values rather
than
simply
having dialog boxes pop up. In that way, you can put as much or
as
little
in
the way of instructions as you like.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I have several reports that are run by queries. Most of these
queries
have
date range parameters that must be entered by the operator. I
have
one
query
that I ask only for a week ending date. This is driving mgmt
nuts
because
they are used to entering a beginning date first, followed by
the
ending
date. I hard wire the beginning date myself. How can I get a
msg
box
to
pop
up to tell people what my hardwired date is? Ideas?
 
G

Guest

I found the problem finally. It was a combination of mistakes in the query.

Thanks for your time and efforts.

Douglas J. Steele said:
What's in Attend-Date: a valid date, or a date/time (because it was
populated using the Now function)? If it's a date/time and all you're
entering is a date, that's likely a problem. Try

HAVING DateValue(Attendance.[Attend-Date])=[Forms]![Data Entry
Driver]![Text1]

instead, although realistically it would be more efficient to combine both
of those into the Where clause:

WHERE Staff.Supervisor=[Forms]![Data Entry Driver]![Combo3]
AND DateValue(Attendance.[Attend-Date])=[Forms]![Data Entry Driver]![Text1]

If that doesn't solve the problem, while the form is open and populated,
open the Immediate Window (Ctrl-G)

Type

?[Forms]![Data Entry Driver]![Combo3]

(complete with the question mark) and hit Enter. What's returned? Does it
correspond to what you expect to find in the Supervisor field?

For that matter, what are you typing into Text1?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Bunky said:
It does not ask for a prompt; justs gives me nothing but a report heading.

SQL -
SELECT Staff.Specialist, Sum(Attendance.Points) AS SumOfPoints,
Attendance.[Attend-Date], Max(Attendance.[Attend-Date]) AS
[MaxOfAttend-Date]
FROM Staff LEFT JOIN Attendance ON Staff.Specialist =
Attendance.Specialist
WHERE (((Staff.Supervisor)=([Forms]![Data Entry Driver]![Combo3])))
GROUP BY Staff.Specialist, Attendance.[Attend-Date]
HAVING (((Attendance.[Attend-Date])=([Forms]![Data Entry
Driver]![Text1])));

Douglas J. Steele said:
When you say it doesn't recognize the two controls, what do you mean? Are
you saying that it still pops up a prompt rather than accepting what
you've
got in the controls, or are you saying that it's returning everything?

What does the SQL of your query look like now?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Yes, I punch a command button on the open form after I fill in the two
entry
boxes; one pull down and one entry.

:

Is the form open when you run the query? Access will not open it for
you.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


OK. I have a query that has the following as the criteria.
([Forms]![Data Entry Driver]![Text1]) where Text1 is the name of the
control. It is a simple textbox. Then I also would like the form
Data
Entry
Driver to have a combo box on it to select a supervisor & have that
value
passed to the query as well. It does not recognize either the
textbox
or
the
combo box.
([Forms]![Data Entry Driver]![Combo3]) is what I have as the
criteria
to
get
the supervisor. Ideas?

:

Close. You need to change your queries so that rather than having
[Enter
Start Date:] as a parameter, they refer to the control on the form
(Forms![NameOfForm]![NameOfControl]). You'd add a command button on
the
form
that invokes the OpenReport method.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)



I haven't ever used a form that way but I like the sound of it.
Let
me
see
if I get it. I would design a form and on this form would be a
textbox
for
end date and I would hard wire the date I want to always use as
begin
date
also in a textbox. After client enters data, somehow the query
is
launched
(how would that happen?). Is that close?
:

I believe you're describing pop-up Parameter Input Boxes, not
message
boxes.

One option is to use a form to enter the parameter values rather
than
simply
having dialog boxes pop up. In that way, you can put as much or
as
little
in
the way of instructions as you like.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I have several reports that are run by queries. Most of these
queries
have
date range parameters that must be entered by the operator. I
have
one
query
that I ask only for a week ending date. This is driving mgmt
nuts
because
they are used to entering a beginning date first, followed by
the
ending
date. I hard wire the beginning date myself. How can I get a
msg
box
to
pop
up to tell people what my hardwired date is? Ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top