columnhidden on a report

bigmac

Registered User.
Local time
Today, 10:12
Joined
Oct 5, 2008
Messages
302
hello all can you help please , can you use "columnhidden on a report" I can get this to work on forms but not reports , if you can use it on a report what would be the correct syntax please , if not how do I hide columns on a report based on tickbox's for each column that are on a form .:confused:
 
you can use the Open event of the form to set the Width of the control to 0. and set the BorderStyle to 0 (no border). ie:

private sub report_open(cancel as integer)
me.columnToHide.Width = 0
me.columntoHide.BorderStyle = 0
end sub
 
hi arnelgp, just one issue with this , if I use this on a column this is in between two other columns then it leaves a space on the report, how do I get the visble columns on the right of the one I have just shrunk to move right ?
 
you will need to modify the control left property - to follow on from arnelgp

private sub report_open(cancel as integer)
me.columnToHide.Width = 0
me.columntoHide.BorderStyle = 0
me.nextcolumn.left=me.columntohide.left
end sub

if this is a subreport, the other alternative is to use a form in datasheet as your subreport and use

me.columntoHide.columnwidth=0
 
if the format of your report is columnar, just edit your report. select all the column heading and the textboxes/comboboxes at the detail sections. then on the ribbon->Arrange, select Tabular. this will group all your headings and control fields. you can now use the code i posted you. the columns will adjust leaving no blank column in place.
 

Users who are viewing this thread

Back
Top Bottom