Hiding columns in a subform datasheet (1 Viewer)

Beacher

Registered User.
Local time
Today, 01:45
Joined
May 13, 2005
Messages
11
Morning all, I'm trying to hide a column of a datasheet in a subform I have... if I run the form and right click and hide the column, it doesen't save that the next time I load it (wasn't sure if it was suppose to, but after reading http://office.microsoft.com/en-us/a...2362201033.aspx it would appear so) I'm using SQL Server 2000, not 7 so I would think that problem shouldn't come up for me yet it is, I need to hide a couple columns from the user (mostly ID columns) while they are entering in data, anyone have any advice they could throw my way?

Much appreciated

- Chris
 

godofhell

Database Guru
Local time
Today, 01:45
Joined
May 20, 2005
Messages
180
If you are displaying the records in a form viewed as a datasheet, you should be able to set the onload event of the form and hide the fileds you want from there.

Sub onload
IDfild.visible= False
End Sub
 

Beacher

Registered User.
Local time
Today, 01:45
Joined
May 13, 2005
Messages
11
Hmm I just tried that, it just doesen't hide it.. no error but it loads as normally and shows the field right there :( I tried hiding the field in design mode AND runtime neither work
 

godofhell

Database Guru
Local time
Today, 01:45
Joined
May 20, 2005
Messages
180
Post a copy of your database and I will make it hide the colum, just tell me which one.
 

strep21

Registered User.
Local time
Today, 10:45
Joined
May 27, 2005
Messages
11
Strange .... I thought I posted an answer yesterday, but don't see it.
So here it is again :

To hide field Me.txtID in your subform datasheet view.
In your subform's open event :

Private Sub Form_Open(Cancel As Integer)
Me.txtID.ColumnHidden = True
End Sub
 

godofhell

Database Guru
Local time
Today, 01:45
Joined
May 20, 2005
Messages
180
Strep21, got it right. That works for datasheets. My suggestion only works for continues and form view forms.
 

Users who are viewing this thread

Top Bottom