Moving controls on reports

Dave Eyley

Registered User.
Local time
Today, 05:35
Joined
Sep 5, 2002
Messages
254
Hi All,

I have a report with an address block consisting of 5 controls (street,area,town,county,postcode). It has to be positioned correctly for a windowed envelope which in itself is relatively easy. My problem is I have a piece of code to shift the controls town, county and postcode up if area is null to avoid a gap in the address block.

I put this code in the OnCurrent event on the report

If IsNull(Me!Area) Then
Me!Area.visible=False
Me!Town.Top=1.508.
Me!County.Top=1.984
Me!Postcode.Top=2.46
Else
Me!Area.visible=True
Me!Town.Top=1.984
Me!County.Top=2.46
Me!Postcode.Top=2.937
End If

The code above moves the code but not where it's supposed to go...
Any help or guidance would be appreciated...

Access 2010
 
Thanks Spikepl,

Worked a treat...

Dave
 
And just as a learning moment -

Measurements in VBA use TWIPS and there are 1440 TWIPS in an inch and 567 TWIPS in a centimeter. So, if you were to want to move it in cm's you would use:

Code:
Me!Town.Top=1.508 [COLOR=blue][B]* 567
[/B][/COLOR]Me!County.Top=1.984 [COLOR=blue][B]* 567
[/B][/COLOR]Me!Postcode.Top=2.46 [B][COLOR=blue]* 56[/COLOR][/B]7

or you can use something like this:
Code:
[COLOR=blue][B]Const TW As Integer = 567[/B][/COLOR]
 
Me!Town.Top=1.508 [B][COLOR=blue]* TW[/COLOR][/B]
Me!County.Top=1.984[COLOR=blue][B] * TW
[/B][/COLOR]Me!Postcode.Top=2.46 [B][COLOR=blue]* TW
[/COLOR][/B]
 

Users who are viewing this thread

Back
Top Bottom