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?