Change left margin in an event procedure

voslica

Registered User.
Local time
Today, 12:21
Joined
Aug 24, 2006
Messages
32
I have two text boxes (Text1 and Text2). When the value in Text2 = 0, I want the left margin of Text1 to change to a new position on the report.

I tried the code below:

If Me.Text2 = 0 Then
Me.Text1.Left = 3.5
Else
Me.Text1.Left = 2.5
End If

This didn't work. Can anyone help me with the visual basic code?
 
Twips

Access uses Twips as a measure unit.
Try
TextBox1.Left = (2.5 * 567)
to place the textbox 2.5 centimetres from the Left.

Alternatively, you can create a
Public Const CMUnit as Long = 567
in a Module

Then you can simply use:
TextBox1.Left = 2.5*CMUnit

Good luck
 

Users who are viewing this thread

Back
Top Bottom