I must be doing something wrong. I put the unbound fields in the header and
called them dtStart and dtEnd. Then I referenced them in the query criteria
line for the call_date field. When I open the query it opens a dialog box
and asks for the dates in a dialog box that references the form then and
gives me data based on the dates I entered, but when I open the form, it
just opens with no data and no dates in the unbound text boxes in the
header. The form uses the query as it's data source. Below is the SQL for
the query. Any thoughts?
Best regards,
Scott B
SELECT [tblRunInfo].[run_number], [tblRunInfo].[call_date],
[tblRunInfo].[call_time], [tblCallNames].[last_name1],
[tblCallType].[call_type], [tblRunInfo].[call_type_ID],
[tblRunInfo].[call_location], ([first_name1] & " " & [mi1]+". " &
[last_name1] & " and "+[first_name2]+" "+[mi1]+". "+[last_name1]) AS
[Names], ([address1] & " " & [address2]) AS Address, ([city] & ", " &
[state] & " " & [zip]) AS CityStateZip, [tblRunInfo].[run_sheet],
[tblRunInfo].[bfir], [tblRunInfo].[pcr], [tblRunInfo].[ekg],
[tblRunInfo].[misc], [tblRunInfo].[mutual_aid_given],
[tblRunInfo].[mutual_aid_received], [tblDepartments].[mutual_aid_dept_name]
FROM tblDepartments RIGHT JOIN (tblCallType RIGHT JOIN (tblCallNames RIGHT
JOIN tblRunInfo ON [tblCallNames].[ID]=[tblRunInfo].[tblCallNames_ID]) ON
[tblCallType].[call_type_ID]=[tblRunInfo].[call_type_ID]) ON
[tblDepartments].[ID]=[tblRunInfo].[mutual_aid_dept_id]
WHERE ((([tblRunInfo].[call_date]) Between
[Forms]![frmCallsByDateChooseDate]![dtStart] And
[Forms]![frmCallsByDateChooseDate]![dtEnd]))
ORDER BY [tblRunInfo].[call_date], [tblRunInfo].[call_time],
[tblCallType].[call_type];
tina said:
one quick, easy solution that comes to mind is to create the form as
continuous form view (or single form view, if it suits your needs), and put
two unbound controls in the form header, as dtStart and dtEnd. write your
query or filter to reference those two controls.
unless you write code to clear the controls, the entered dates will stay
there until 1) the user manually deletes them, or 2) the user types over
them, or 3) the form is closed.
if you're filtering records in the form, and then want to run a report
showing the same records, those two unbound controls can do double duty as
references to filter the report records also.
hth
type filter
the
but)