displaying selected fields on a report from a form.

W

Wininly

Hi,

I am having trouble displaying selected fields that i
choose in a form to a report.

Eg: In a form, I had created a few option buttons, if the
option buttons = "true", then that field will shown in the
report.

really appreciate all the helps here!!!

Thanks!!!

Cheers,
Wininly
 
M

Marshall Barton

Wininly said:
I am having trouble displaying selected fields that i
choose in a form to a report.

Eg: In a form, I had created a few option buttons, if the
option buttons = "true", then that field will shown in the
report.

This can get complicated depending on what you mean by shown
or more importantly NOT shown. In the simplest situation,
you can use a little code in the report's Open event
procedure:

Me.somecontrol.Visible = Forms!theform.optionbutton
 
L

Larry Linson

Provided the Form is still open, you can refer to the Form Controls from VBA
code within the Format or Print event of the Report, and set the Visible
properties of Report Controls accordingly... an example might be:

If Forms!frmMyForm!optButton1 = True Then
Me.txtControl1.Visible = True
Else
Me!txtControl1.Visible = False
End If

Larry Linson
Microsoft Access MVP
 

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