column width in continuous form

  • Thread starter Thread starter Fev
  • Start date Start date
F

Fev

Hi
I have a continous sub form (based on the advice on not using a
datasheet in this forum). I would like to show and hide columns based
on check boxes in the main form, however when a column is hidden based
on the check box, I would prefer not to have a blank space. Is it
possible to change the column width as well, so that if columns 1 and
3 are hidden, columns 2 and 4 will appear next to each other. I have
tried this code, but am not getting the result I would like:
Private Sub chkPta_Click()
If chkPta = -1 Then
Me!frmLSMBreakdown.Form!txtPta.Visible = True
Me!frmLSMBreakdown.Form!lblPta.Visible = True
Me!frmLSMBreakdown.Form!txtPta.ColumnWidth = 1.5

Else
Me!frmLSMBreakdown.Form!txtPta.Visible = False
Me!frmLSMBreakdown.Form!lblPta.Visible = False
Me!frmLSMBreakdown.Form!txtPta.ColumnWidth = 0
End If
End Sub
Thanks
Heather
 
Heather:

Although I am not a fan of datasheets this may be most applicatle for you criteria.
I am using an approach based on a selection from a ComboBox on a Main Form:

If Me.cboColumns.Value = "ValueStream" Then
Me.frmItem_Detail_All.Form!txtVS_Centrifuge.ColumnHidden = False
Me.frmItem_Detail_All.Form!txtVS_LSA_CE.ColumnHidden = False
Me.frmItem_Detail_All.Form!txtVS_Plastics.ColumnHidden = False
Me.frmItem_Detail_All.Form!txtVS_Rotors.ColumnHidden = False
Else
Me.frmItem_Detail_All.Form!txtVS_Centrifuge.ColumnHidden = False
Me.frmItem_Detail_All.Form!txtVS_LSA_CE.ColumnHidden = False
Me.frmItem_Detail_All.Form!txtVS_Plastics.ColumnHidden = False
Me.frmItem_Detail_All.Form!txtVS_Rotors.ColumnHidden = False
End If

Hope this helps.
Mark
 
Back
Top