Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / December 2005

Tip: Looking for answers? Try searching our database.

Pick List In Report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shep - 25 Dec 2005 17:45 GMT
MS Office 2003 Pro

I have a table that stores phone calls with contacts:
 Table: Calls
Columns
Name Type Size
CallID Long Integer 4
ContactID Long Integer 4
CallDate Date/Time 8
CallTime Date/Time 8
Subject Text 255
Notes Memo

I have a query to call a Date Range Form, which includes a Popup calendar to
set date range for a report of calls:

Query: qryCallsV1
SQL
SELECT qryContactNameV1.ContactName, Calls.CallDate, Calls.CallTime,
Calls.Subject, Calls.Notes
FROM Calls INNER JOIN qryContactNameV1 ON
Calls.ContactID=qryContactNameV1.ContactID
WHERE (((Calls.CallDate)>=forms!frmReportDateRangeV1![Start Date] And
(Calls.CallDate)<=forms!frmReportDateRangeV1![End Date]))
ORDER BY qryContactNameV1.ContactName;
Columns
Name Type Size
ContactName Text 0
CallDate Date/Time 8
CallTime Date/Time 8
Subject Text 255
Notes Memo N/

I would like to also be able to select a  Contact for the report rather than
getting all contacts.  How can I do that?

Thanks
Steve Schapel - 25 Dec 2005 18:24 GMT
Shep,

On your frmReportDateRangeV1 form, as well as the controls for the date
range selection, you can put an unbound combobox, where the Row Source
will be based on the list of Contacts.  Probably the most commonly used
approach here would be 2 columns in the combobox, with ContactID and
ContactName, with Column Widths property set so that ContactID is the
bound column but hidden and ContactName is displayed.  Let's say this
combobox is named ContactSel, then in the query for the report, you will
put this in the Criteria of the ContactID field...
 [Forms]![frmReportDateRangeV1]![ContactSel]
... and thus the Where clause of the query's SQL will look something
like this...
  WHERE (((Calls.CallDate) Between
[Forms]![frmReportDateRangeV1]![Start Date] And
[Forms]![frmReportDateRangeV1]![End Date]) And
((Calls.ContactID)=[Forms]![frmReportDateRangeV1]![ContactSel]))

Signature

Steve Schapel, Microsoft Access MVP

> MS Office 2003 Pro
>
[quoted text clipped - 33 lines]
>
> Thanks
shep - 25 Dec 2005 20:10 GMT
Thank you very Much;  Just what I needed

> Shep,
>
[quoted text clipped - 51 lines]
> >
> > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.