Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Field Parameters via VBA code 1

Status
Not open for further replies.

Vidar13

IS-IT--Management
Apr 4, 2001
90
0
0
US
I have a report that I want to be able to change the layout via code, from data supplied from a table. I'm trying to change the top/left positing of the report fields on the fly to meet the demands specified in a parameter table.

It doesn't appear there are any field positioning controls that are available in the report load event?? Is there another way to go about this?
 
Every control on the report has a 'Top', 'Left' and 'Width' property that can be set via code. The 'Top' and 'Left' properties refer to the control's position within a report section. See online Help for details on these properties.
 
You need to handle this in the 'Format' event for the particular section the controls reside in. For example, this code moves and makes visible an OLE control in the first Group Header section:

Code:
Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
  If Me.Total > 20000 Then
    Me.OLEBound10.Properties("Left") = 200
    Me.OLEBound10.Visible = True
  End If
End Sub
VBSlammer
redinvader3walking.gif

Unemployed in Houston, Texas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top