iif syntax in Access report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to change the size of a text box field in an Access report based on
the content of another field in the report. I tried the following in the Data
Source property with no success. The subject field is Text14.

=IIf([jan]=1,"Text14.Top=0.0417","Text14.Top=0.1201")

I tried it with and without " marks.

I want to control both the top and height of the field, so I need to know
how to include more than just the top property in the above function.

Thanks
 
You need to modify control properties in the code window.
'measurements are generally in twips (1440 per inch)
'this code should be in the On Format event of the report section that
contains the controls
If [jan]=1 Then
'reminder to self - find a better name for Text14
Me.Text14.Top=0.0417 * 1440
Else
Me.Text14.Top=0.1201 * 1440
End If
 
If you want to change the size, you need to set .width and/or .height.
..top will only change the position, which you may need to also do after you
reset to position.

Mike Schlosser


Duane Hookom said:
You need to modify control properties in the code window.
'measurements are generally in twips (1440 per inch)
'this code should be in the On Format event of the report section that
contains the controls
If [jan]=1 Then
'reminder to self - find a better name for Text14
Me.Text14.Top=0.0417 * 1440
Else
Me.Text14.Top=0.1201 * 1440
End If

--
Duane Hookom
MS Access MVP


Frank said:
I want to change the size of a text box field in an Access report based on
the content of another field in the report. I tried the following in the
Data
Source property with no success. The subject field is Text14.

=IIf([jan]=1,"Text14.Top=0.0417","Text14.Top=0.1201")

I tried it with and without " marks.

I want to control both the top and height of the field, so I need to know
how to include more than just the top property in the above function.

Thanks
 
Back
Top