Avatar of Lawrence Salvucci
Lawrence Salvucci
Flag for United States of America asked on

Report Control Left Margin

I have a control on my report that I want to shift the margin over .5" when there is a value in another control. If that other control is empty I want the margin of this control to stay left justified. If it's not null then I want to move the left margin .5". How do I write this in vba code and which event of the report should this go in?
Microsoft Access

Avatar of undefined
Last Comment
PatHartman

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
PatHartman

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Lawrence Salvucci

ASKER
That doesn't seem to be working. I tested it and it doesn't seem to be moving the left margin. Here's what I have in the format event:

If Me.txtResultsValue & "" <> "" Then
    Me.Results.LeftMargin = 0.5
Else
    Me.Results.LeftMargin = 0
End If

Open in new window

Lawrence Salvucci

ASKER
I got it working. Thank you for your help!
PatHartman

You probably won't see a difference unless the control is full.  Try making the offset larger so that you can see it do something.  Perhaps, LeftMargin is not the property you want to adjust.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck