How to move column forward?

G

Guest

Hello,

I have a multicolumn report which looks like one below. This report takes
data from the table. I created this report using report wizard.
Now, lets say for activity A there is no activity for customer in "column
a" I would like the "column b" the aautomatically move forward.
Similarly say for Activity B , there is no record for "column a" and
"column b" In this case I would like the "column c" occupy the place of
"column a"so on and so on.
I have set all the text box and sections "Can shrink" property to "Yes". by
doing this nothing happened. may or it may be due to the line between
different headers? or i need to do something else, please help.

There is a line beteeen column header and column
_____________________________________________
Name
ID
_____________________________________________
Activity A ********
_____________________________________________
Column a Column b Column c Column d
_____________________________________________



_____________________________________________
Activity B************
_____________________________________________
Column a Coulmn b Column c Column d
 
J

John Spencer

Are you moving just the data or are there associated labels that have to be
moved also?

On alternative would be to move the bound controls around.

In the Format event of the relevant section
'Set the controls to their default positions (Inches * 1440)
Me.Text2.Left = 1.5*1440
Me.Text3.Left = 2.75*1440
Me.Text4.Left = 4*1440

Now, start moving them on top of each other as appropriate

If IsNull(Me.text1) Then
Me.text2.Left = Me.Text1.Left
End if

If IsNull(Me.Text2) then
Me.text3.Left = me.Text2.Left
End if

If IsNull(Me.Text3) then
Me.text4.Left = me.Text3.Left
End if

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
G

Guest

Thanks for the reply.
I need to move column togther with its heading. I tried your suggestion in
Detail section Where all my data are) of the report. When i run the programme
it says "run time error 438", The object does not support this property or
method.

I also tried using "Moveleft"instead of left, that also doesnot work.
 
J

John Spencer

Ok, I don't know why it didn't work for you. It works for me in my test

This was a simple test that I ran in a test database and it worked
perfectly.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.txtFormatted.Left = Me.txtSomeNumber.Left
End Sub

I did forget to mention that you will probably want to set the control's
back style to transparent or make sure that the "stacking" order of the
controls is such that Control 2 is in front of Control 1, Control 3 is in
front of control2, etc.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
G

Guest

it worked following way

I put following on report section " onactivate"

Me.text2.Left = Me.Text1.Left
Me.text4.Left = me.Text3.Left
etc and offcourse i change text to my fields name
I didnt use If function

Anyway now its working perfectly,
Thanks for your the suggestion
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top