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 / Modules / DAO / VBA / December 2005

Tip: Looking for answers? Try searching our database.

Using Check boxes to select reports

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul M - 28 Dec 2005 23:45 GMT
I am a noobie, I have built a database that has 1 form getting it's
information from 1 table. this form sends the information to several reports
and autofills the information from the table to the fields in each report.

what I would like to do is (without having to learn VB) make check boxes in
the form that allow the user to choose the reports they want to print, and
have a print button that will control it all.

with that in mind, I would like the check boxes to only allow the currently
information in the form (and the coresponding report) to print once they are
selected.

Any suggestions?

Paul M
Allen Browne - 29 Dec 2005 01:53 GMT
You will need to learn some VBA to achieve the interface you describe.

For an example of how to create an option group so the user can select one
to print, open the Northwind sample database that installs with Access. Open
the form named Sales Report Dialog in design view, and examine how it is set
up.

For an example of how to limit the report to just the record selected in
your form, see:
   Print the record in the form
at:
   http://allenbrowne.com/casu-15.html

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I am a noobie, I have built a database that has 1 form getting it's
> information from 1 table. this form sends the information to several
[quoted text clipped - 15 lines]
>
> Paul M
Paul M - 29 Dec 2005 17:02 GMT
Allen,

this did help some, though the Northwind database has alot to offer, there
is nothing that helps me.

example... if I have 7 (seven) check boxes and each one controls (when
checked) if a report is printed or not, I want to be able to check 5 out of
the 7 and have the print button print only those with the current information
being viewed.

like I said, the Northwind Data base was little or no help, but the
information you supplied was 10 times more helpful.

Paul M

P.S. the code you had one your web site did teach me a little about VB
Allen Browne - 30 Dec 2005 02:48 GMT
Okay, you want to be able to select multiple reports to print, not a report
in an option group (as Northwind does.)

Your code will need to OpenReport for each checkbox that is checked. This
example assumes  a check box named "chkReport1", and - if checked -
"Report1" is to open, limited to the value in the ID (Number field) in the
form, when you click the command button named "cmdPreview":

Private Sub cmdPreview_Click()
   Dim strWhere As String
   Dim lngMode As Long

   lngMode = acViewPreview
   strWhere = "[ID] = " & Me.[ID]

   If Me.chkReport1 = True Then
       DoCmd.OpenReport "Report1", lngMode, , strWhere
   End If

   If Me.chkReport2 = True Then
       DoCmd.OpenReport "Report2", lngMode, , strWhere
   End If

   'etc.
End Sub

If you wanted the reports to print instead of previewing, change line 2 to:
   lngMode = acViewNormal
Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> this did help some, though the Northwind database has alot to offer, there
> is nothing that helps me.
[quoted text clipped - 12 lines]
>
> P.S. the code you had one your web site did teach me a little about VB
Paul M - 30 Dec 2005 18:00 GMT
If there were one word to describe how helpful this information was, I don't
think it exists on this planet.

AWESOME, FANTASTIC, PERFECT AND ON TARGET!

Thank you Allen Browne for this more then just useful information, I don't
know what I would have done without it.

Warmest Regards,

Paul M

> Okay, you want to be able to select multiple reports to print, not a report
> in an option group (as Northwind does.)
[quoted text clipped - 41 lines]
> >
> > P.S. the code you had one your web site did teach me a little about VB
 
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.