Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Radio buttons to print report

Status
Not open for further replies.

alrandal

Programmer
Oct 1, 2002
27
0
0
US
I would like to have a form, that has radio butoons next to a record and if my user wants to print the report for that one record they would select the radio button and then print, or if they have 5 out of 10 records they would like to print they would select each radio button and it would only print those 5 and not all 10. Can this be done?
 
I would use a check box and a true false field in the table...

That way, when you hit print, It can call a report that is based on a query that will only display the one's with True in that field...

Then after the code run's to print, You can have it reset all the check box's to false if you'd like... I've done that befor...

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Thats what I have now, I have a yes/no field on my table called print, if its checked then print the report if not the dont, Im just not sure how to code this to work properly. Thanks for the help
 
ok, you said radio button up top... I guess that threw me... Do you have it already so far that you can change the radio button and it will change the field in the table??

junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
yes, thats how its set, I will use a check box or radio button, it doesnt matter as long as it changes to yes/no or true/false, as long as it will tell the code print or dont print. I would like something as follows.

If Me.checkbox = True Then
DoCmd.printReport "ReportName"
End If

This code doesnt work, do you have something like this that will work?
 
wait a minute, you didn't answer my question. Do you have that part working already?? I need to know where to start...

Do i need to work with you to get that working, or do I need to do that and the report side of it? or you have that working and we just need to get the report to print how you want...

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Oh ok, Ive got a report already, all I need is the code that says if this check box is checked then print just this record in the report, right now I have like 50 records in the report, but when a user wants to print just one, they cant, they have to print the entire 50, thats not what I want, I want them to be able to just print the selected records by a check box. I have a form setup already and I already have check box on it that is linked to the table.
 
ok, Now I know where to start...

This report...

open the report in design view.

open up the properties for the report.
click on the data tab.
turn filteron to Yes.
in the filter box, put some thing like this, just change the field to be the checkbox field you made...

[CheckBox] = True

And let me know how that works for you...

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
No thats not going to work because it askes for a parameter value, I dont want them to have to enter a value, I want it to know that the check box is set to true, and thats the only value it will need to print.
I appreciate all the help.
 
if the checkbox field from the table is in the recordsource, it shouldn't ask for a paramater... try adding a check box that bound to that field in the report using that filter... make sure the name is correct to the field name too...

--James.
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Is still asking for a parameter value, my check box is bound to a yes/no fiels in the record source, I also put the same checkbox on the report bound to the same yes/no field in the table, I turned filter on and in filter I put

printcheck = true

can you tell whats wrong?
 
Ok ive got it working now here is what I used:

Private Sub print_Click()

Dim strSQL As String

'Create the Where Clause for printing selected records
strSQL = "printcheck = True"

DoCmd.OpenReport "CustomerIssues", acViewPreview, , strSQL
strSQL = "UPDATE [CustomerIssues] SET printcheck = False"

DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True


End Sub

I appreciate all your help, Thank You for being patient
 
Good job man. junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top