Move Text Box

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

Guest

Can I move (using VB) a Text Box on Report based on value on form? A form
control has value of "1" then I want the text box Left property to = .125 but
value = "2" then want Left property to be .150.

Can text box automatically be moved through coding or do you have manually
do it?

Thanks for any help.

Lamar
 
Can I move (using VB) a Text Box on Report based on value on form? A form
control has value of "1" then I want the text box Left property to = .125 but
value = "2" then want Left property to be .150.

Can text box automatically be moved through coding or do you have manually
do it?

Thanks for any help.

Lamar

You can do it using code in the section's Format event, but you must
remember that Access measurements are in Twips, 1440 per inch.

Are those the only 2 choices, 1 or 2? Then ....

If Forms!FormName!ControlName = 1 Then
Me![ControlName].Left = 1440 * 1.25
Else
Me![ControlName].Left = 1440 * 1.50
End If

The form must be open when the report is run.
 
Lamar said:
Can I move (using VB) a Text Box on Report based on value on form? A form
control has value of "1" then I want the text box Left property to = .125 but
value = "2" then want Left property to be .150.

Can text box automatically be moved through coding or do you have manually
do it?


Use the text box section's Format event:

If Forms!theform.formcontrol = 1 Then
Me.textbox.Left = .125 * 1440
Else
Me.textbox.Left = .15 * 1440
End if

The units of measurement in in twips (1440 per inch) so the
multiply is required to convert from inches to twips.
 

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

Back
Top