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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Options from a form

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I have a form with a series of Check boxes and a command button. What i'm trying to do is, let the user select the fields they would like to see on a report by checking the check boxes. My code for the report is as follows:

if forms![formname]![checkbox].Value = True Then
filedname.visable = true
else
fieldname.visable = false
end if

the problem is I get an error saying that function is not available or something like that..

I've tryed the code on Detail, on Open on Activate and nothing works..

does anyone know a way to make this work?

Thanks in advance

>:):O>



DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 
You need to be a little more specific, both in the error code being generated and in the code you are posting. For example: "filedname.visable = true" probably should be; "fieldname.visible = True". So I don't know if it's just a spelling error in your post here or if it's a spelling error in your actual code.
 
sorry, it is a spelling error in the post...but heres the error message i am getting

Run-Time error 438
Object doesnt support this property or method

here the code i was testing to do this

form:

Private Sub Command6_Click()
DoCmd.OpenReport "report1", acViewPreview
End Sub

Report:

Private Sub Report_Open(Cancel As Integer)

If Forms![form3]![Check4].Value = True Then
sampleno.visable = True
Else
sampleno.visable = False
End If
End Sub

Thanks


DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 
Ah, now we know. You cannot set these properties when you Open the report. Move the code to the OnFormat event for the section the controls are in.
 
No, it still doesnt work...this is weird.

the visable option is not even in the drop down list at all..

any ideas?? DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 
never mind I got it...what i did was create unbound fields on the report and depending what check boxes on the form were checked thats what the text boxes would show..



DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top