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 / April 2008

Tip: Looking for answers? Try searching our database.

Form filter then print report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Golfinray - 21 Apr 2008 15:25 GMT
I would like to have a little form that filters by selection a particular
record, then have a command button that selects that record in a report and
then prints the record. Or is there a better way? I can get the form and
filter to work, but how do you do the calling of the record in the report and
then print only that one record? Thanks so much!!!!
Klatuu - 21 Apr 2008 17:41 GMT
Use the Where argument of the OpenReport method.  You identify a field that
will have a unique value in the field.  This is usually the table's primary
key.  It is the fourth argument of the method:

   Docmd.OpenReport "ReportName", , , strWhere

Now, to get the value in the strWhere variable, you may consider using a
combo box on you form that will return the value.  So strWhere needs to look
like an SQL WHERE clause without the word where.  Say your report's recordset
primary key field is named ClientID and you have a combo on the form that
returns ClientID and ClientName and the ClientID column is the bound column.  
it would be like:

   strWhere = "[ClientID] = " & Me.cboClientSearch

Signature

Dave Hargis, Microsoft Access MVP

> I would like to have a little form that filters by selection a particular
> record, then have a command button that selects that record in a report and
> then prints the record. Or is there a better way? I can get the form and
> filter to work, but how do you do the calling of the record in the report and
> then print only that one record? Thanks so much!!!!
Golfinray - 21 Apr 2008 18:40 GMT
As usual, Dave, "You the man!"

> Use the Where argument of the OpenReport method.  You identify a field that
> will have a unique value in the field.  This is usually the table's primary
[quoted text clipped - 16 lines]
> > filter to work, but how do you do the calling of the record in the report and
> > then print only that one record? Thanks so much!!!!
 
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.