Hide columns in Datasheet in Subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a form setup with a subform within it. The subform is currently in a
Datasheet view. I would like to stop a column from being viewed. Is there
anyway to do this? I have set the property setting "visible" to No but the
column is still appearing.

Thanks for your help
 
Change the view of the subform to Continuous Forms view; change the design
so that the textboxes are situated just the same as they'd be in a datasheet
view (you can put the header labels in the form's Form Header section).

There is a property in datasheet view where you can right-click on a column
and "hide" the column, but I'm not sure that a user is prohibited from
changing it back. So go with the idea above -- invisible controls then stay
invisible.
 
you can use the following code in the subform to hide the column in the
subform datasheet, as

Private Sub Form_Load()

Me!LineNumber.ColumnHidden = True

End Sub

Private Sub Form_MouseUp(Button As Integer, _
Shift As Integer, X As Single, Y As Single)

' note that the following two lines actually go all on one line

If Me!LineNumber.ColumnHidden = False Then Me!LineNumber.ColumnHidden =
True

End Sub

to stop the user from choosing Format | Unhide Columns from the menu bar,
you need to disallow full menus (Tools | Startup), or create a custom menu
for the form, that does not include the UnhideColumns and ColumnWidth
options. similarly, you need to set the subform's ShortcutMenu property to
No, or create a custom shortcut menu that doesn't include the ColumnWidth
option.

hth
 
Back
Top