473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

change report controls .left property at runtime

1,271 Expert 1GB
I have a report that is often being modified by management. Adding/deleting columns and total levels plays havoc with alignment. I want the report to self arrange all the columns.

The left position of column 2 should start at column1.left + column1.width; column3 should start at column2.left+column2.width and so on.

I created a little bit of code to test this and I am stuck on this error:
"the setting you entered isn't valid for this property"

The code appears below. As you can see I can successfully query the properties of the controls and I can even set the .visible property. But I cannot set the .left property.

In this example the controls are labels in the heading area. But I want to do the same to text boxes in the detail area.

Any ideas?
Thanks,
Jim

Private Sub PageHeaderSection_Print(Cancel As Integer, PrintCount As Integer)

dim intA as integer
With Me
' use intA to test querying these values
intA = !lblOpenOrderAmount.Left
intA = !lblOpenOrderAmount.Width
intA = !lblOpenOrderCount.Left
intA = !lblOpenOrderAmount.Left + !lblOpenOrderAmount.Width
' so far, so good
' test to see if the .visible setting can be changed without error
!lblOpenOrderCount.Visible = false
!lblOpenOrderCount.Visible = True

'error occurs on the following line, no matter what I put to the right of the =
!lblOpenOrderCount.Left = 1 ' (!lblOpenOrderAmount.Left + !lblOpenOrderAmount.Width)

end with

end sub
Aug 12 '09 #1
1 5807
jimatqsi
1,271 Expert 1GB
Got the solution, the problem is I put the code in the Print event and I should have put it in the Format event code. Works great now :)
Aug 13 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Donna Sabol | last post by:
First, I should start by saying I am creating a database to be used by some very impatient, non-computer literate people. It needs to be seameless in it's operation from their point of view. I...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
4
by: ALESSANDRO Baraldi | last post by:
Hi and Good Sunday. Have i any way to Reduce at Runtime, with no change on Design View, the Height property of Detail_Section on my Report.....? The Section Property is Read_Only but if i...
1
by: Mamatha | last post by:
Hi I have an application in VB.NET,in that application one form contains listbox(on the leftside of the form)and datagrid control(on the rightside of the form).Both controls displays data at...
7
by: Mark | last post by:
Hi, I am creating application in VB 2005. and when I print report it adds extra 0.45 cm margin on left and top, and the reason for this is physical margins of printer. Is it possible to change...
2
by: mmcquade | last post by:
Hey gang, I just created a crosstab query to assist in generating reports for class attendance. When I run the report (using temp hard-coded date constraints), I notice that my column...
11
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RowSource of a Master Report is: Me.RowSource = "TableOrQueryName"
3
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RecordSource of a Master Report is: Me.RecordSource = "TableOrQueryName"
0
by: porksmash | last post by:
I'm developing an app here that uses ActiveX controls to connect to industrial cameras over Ethernet. I want to be able to dynamically create those controls at runtime based on how many cameras are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.