Setting Report field properties on open

M

Michael Kintner

I am trying to set a field so it does not get printed in a report when it
opens.

I used to OpenARG statement and it passes the variable fine. However when
trying to turn the field visiblity to false I get an error. Strange?????

Can you change report fields visibility so certain fields do not get printed
on the fly like this?

I tried this with no luck.

Private Sub Report_Open(Cancel As Integer)

If Not IsNull(Me.OpenArgs) Then
InputArgs = Me.OpenArgs
Select Case InputArgs
Case "NoValues"
txtUM_QTY.Report.Visible = False '<<< Fails here and don't
knwo why????
Case Else
End Select
End If

End Sub

Thank you in advance,
Mike
 
F

fredg

I am trying to set a field so it does not get printed in a report when it
opens.

I used to OpenARG statement and it passes the variable fine. However when
trying to turn the field visiblity to false I get an error. Strange?????

Can you change report fields visibility so certain fields do not get printed
on the fly like this?

I tried this with no luck.

Private Sub Report_Open(Cancel As Integer)

If Not IsNull(Me.OpenArgs) Then
InputArgs = Me.OpenArgs
Select Case InputArgs
Case "NoValues"
txtUM_QTY.Report.Visible = False '<<< Fails here and don't
knwo why????
Case Else
End Select
End If

End Sub

Thank you in advance,
Mike

What is this line?
txtUM_QTY.Report.Visible

Is [txtUM_QTY] the name of a control? If so, what is .Report?
You wish to make the control not visible if the OpenArgs = "NoValues"?

Private Sub Report_Open(Cancel As Integer)
If Not IsNull(Me.OpenArgs) Then
Me![txtUM_QTY]. Visible = Not Me.OpenArgs = "NoValues"
End If
End Sub
 
M

Michael Kintner

Thank you Fred!!! That worked great!!!!!


fredg said:
I am trying to set a field so it does not get printed in a report when it
opens.

I used to OpenARG statement and it passes the variable fine. However
when
trying to turn the field visiblity to false I get an error. Strange?????

Can you change report fields visibility so certain fields do not get
printed
on the fly like this?

I tried this with no luck.

Private Sub Report_Open(Cancel As Integer)

If Not IsNull(Me.OpenArgs) Then
InputArgs = Me.OpenArgs
Select Case InputArgs
Case "NoValues"
txtUM_QTY.Report.Visible = False '<<< Fails here and
don't
knwo why????
Case Else
End Select
End If

End Sub

Thank you in advance,
Mike

What is this line?
txtUM_QTY.Report.Visible

Is [txtUM_QTY] the name of a control? If so, what is .Report?
You wish to make the control not visible if the OpenArgs = "NoValues"?

Private Sub Report_Open(Cancel As Integer)
If Not IsNull(Me.OpenArgs) Then
Me![txtUM_QTY]. Visible = Not Me.OpenArgs = "NoValues"
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top