By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,506 Members | 2,275 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,506 IT Pros & Developers. It's quick & easy.

Radio Button Help

mjmorris76
P: 6
I searched key words for awhile and nothing really helped. Could anyone please explain how I could get this to work?

What I want it to do is when I select any number of radio buttons (reports) it then prints each of them I've selected. For example: if the following image was of a database, the report [None] and [Show value] would be printed if both selected and the <Next> button or Print button was clicked. I know that is a bit confusing but it should get the idea acrossed.

For the life of me I can't figure it out. Thank you in advance!

Michael

Sep 17 '07 #1
Share this Question
Share on Google+
5 Replies


ADezii
Expert 5K+
P: 8,599
I searched key words for awhile and nothing really helped. Could anyone please explain how I could get this to work?

What I want it to do is when I select any number of radio buttons (reports) it then prints each of them I've selected. For example: if the following image was of a database, the report [None] and [Show value] would be printed if both selected and the <Next> button or Print button was clicked. I know that is a bit confusing but it should get the idea acrossed.

For the life of me I can't figure it out. Thank you in advance!

Michael

Assuming you have 6 Option Buttons on a Form, and these Option Buttons are named optReport1 thru optReport6, then the following code in the Click() Event of a Command Button with the Caption Print Report(s) will do the trick for you. Just make changes for more or less Reports, Button, and Report Names.
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdPrintReports_Click()
  2. If Me![optReport1].Value = True Then
  3.   DoCmd.OpenReport "Report1", acViewNormal, , , acWindowNormal
  4. End If
  5.  
  6. If Me![optReport2].Value = True Then
  7.   DoCmd.OpenReport "Report2", acViewNormal, , , acWindowNormal
  8. End If
  9.  
  10. If Me![optReport3].Value = True Then
  11.   DoCmd.OpenReport "Report3", acViewNormal, , , acWindowNormal
  12. End If
  13.  
  14. If Me![optReport4].Value = True Then
  15.   DoCmd.OpenReport "Report4", acViewNormal, , , acWindowNormal
  16. End If
  17.  
  18. If Me![optReport5].Value = True Then
  19.   DoCmd.OpenReport "Report5", acViewNormal, , , acWindowNormal
  20. End If
  21.  
  22. If Me![optReport6].Value = True Then
  23.   DoCmd.OpenReport "Report6", acViewNormal, , , acWindowNormal
  24. End If
  25. End Sub
Sep 18 '07 #2

mjmorris76
P: 6
Thank you ADEZII !

BTW - You wouldn't happen to know how to make access output a PDF of a report do you? I seem to only be able to out put these formats: HTML, RTF, TXT, IIS, and XLS. I would use the RTF and convert to PDF, but when the report is output it looses some of its formatting. I have Adobe writer so when I open a report I have a menu drop down to convert it to PDF, but would like to automate the process into my form (i.e. have a print button and a pdf button).

Any ideas?

Thanks again,
Michael

[quote=ADezii]Assuming you have 6 Option Buttons on a Form, and these Option Buttons are named optReport1 thru optReport6, then the following code in the Click() Event of a Command Button with the Caption Print Report(s) will do the trick for you. Just make changes for more or less Reports, Button, and Report Names.
Sep 18 '07 #3

ADezii
Expert 5K+
P: 8,599
[quote=mjmorris76]Thank you ADEZII !

BTW - You wouldn't happen to know how to make access output a PDF of a report do you? I seem to only be able to out put these formats: HTML, RTF, TXT, IIS, and XLS. I would use the RTF and convert to PDF, but when the report is output it looses some of its formatting. I have Adobe writer so when I open a report I have a menu drop down to convert it to PDF, but would like to automate the process into my form (i.e. have a print button and a pdf button).

Any ideas?

Thanks again,
Michael

Assuming you have 6 Option Buttons on a Form, and these Option Buttons are named optReport1 thru optReport6, then the following code in the Click() Event of a Command Button with the Caption Print Report(s) will do the trick for you. Just make changes for more or less Reports, Button, and Report Names.
You're quite welcome. To the best of my knowledge, you cannot directly Output To .PDF Format in Access.
Sep 18 '07 #4

Scott Price
Expert 100+
P: 1,384
[quote=ADezii]
Thank you ADEZII !

BTW - You wouldn't happen to know how to make access output a PDF of a report do you? I seem to only be able to out put these formats: HTML, RTF, TXT, IIS, and XLS. I would use the RTF and convert to PDF, but when the report is output it looses some of its formatting. I have Adobe writer so when I open a report I have a menu drop down to convert it to PDF, but would like to automate the process into my form (i.e. have a print button and a pdf button).

Any ideas?

Thanks again,
Michael


You're quite welcome. To the best of my knowledge, you cannot directly Output To .PDF Format in Access.
Access 2007 has a PDF plugin, but previous versions rely on third party products. Many are available that work just as a printer driver, PDF995 for example. You could create a command button with code that changes your default printer to one of these third parties (or Adobe writer if it provides this functionality as well).

Regards,
Scott
Sep 18 '07 #5

ADezii
Expert 5K+
P: 8,599
[quote=Scott Price]

Access 2007 has a PDF plugin, but previous versions rely on third party products. Many are available that work just as a printer driver, PDF995 for example. You could create a command button with code that changes your default printer to one of these third parties (or Adobe writer if it provides this functionality as well).

Regards,
Scott
Thanks for the information Scott, good to know.
Sep 18 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.