Solved

Trying to hide columns in subform datasheet

Posted on 2011-02-11
16
579 Views
Last Modified: 2012-05-11
I downloaded a Microsoft Template Access DB for Task Management:
http://office.microsoft.com/en-us/templates/task-management-database-TC001225356.aspx

I did it just to learn more about forms and subforms.

Now, I have a question.  I created a new query that added three fields (PastDue, DueToday, and DueThisWeek).  With that query as the record source, I created three forms (used as subforms) that each filter for one of those three criteria.  I then have a main form that has these three as subforms.  

 Main Form
But since I copied and pasted one of the default views, [Open Tasks], and did the same for the subforms, the subform has a lot of fields that I don't wish to show in the subforms.  I could delete them from the forms I assume, but I'm wondering why just checking the visible property on those fields to "No" doesn't work.

 Visible set to No doesn't work
0
Comment
Question by:BBlu
  • 5
  • 4
  • 3
  • +3
16 Comments
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 85 total points
ID: 34877381
You have to use the Column Hidden property in a datasheet ... example:

Private Sub Form_Load()
    With Me
        .Text5.ColumnHidden = True
        .txtEmpName.ColumnHidden = True
        ' and so on ....
    End With
End Sub

mx
0
 

Author Comment

by:BBlu
ID: 34877393
oh, okay.  And that is not a property in the property sheet, right?  I have to use VBA if I don't want to take it out of the original query and form?
0
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 25 total points
ID: 34877449
Or you can just push the column edges together to hide the columns.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 34877914
Oh for goodness' sake - just delete the columns. Why make something trivial so complicated?
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 50 total points
ID: 34878139
<Why make something trivial so complicated?>

The author is asking WHY, not necessarily how. As they stated, they could simply delete the columns, but they were curious as to why it didn't work. Don't you agree that, as a developer, being curious is a good thing :) ?

<I could delete them from the forms I assume, but I'm wondering why just checking the visible property on those fields to "No" doesn't work.>

Datasheet view is a specialized view of an Access form, so many standard properties don't apply. However, the Datasheet form also has many properties that are ONLY applicible to that view. If you review the Properties for a Datasheet form, you'll see many items which are ONLY relevant to that view.
0
 
LVL 29

Assisted Solution

by:Badotz
Badotz earned 20 total points
ID: 34879087
>>Don't you agree that, as a developer, being curious is a good thing

Of course I do. But I have to do my own investigation first, and if I simply cannot grok something, then I seek advice from Google, my library (of books) and EE and other sites. I never throw up my hands after a single bash at something.
0
 

Author Comment

by:BBlu
ID: 34879387

Why so judgmental, Badotz.  I'm actually a VP of Finance with a nerdy developer side.  I did google and I have tried to research.  I've always had success on EE and thought, as if often the case, that I was beating my head against the wall on something that might be easy that I'm overlooking.  No need to be harsh.  I'm just trying to learn here, man.
0
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 70 total points
ID: 34879402
BBlu,
just right click on the column and select hide columns

for multiple columns to hide, hold the shift while highlighting all the columns you want to hide

to unhide, right click on the title bar of the form and select unhide columns
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 119

Expert Comment

by:Rey Obrero
ID: 34879415
you can also use the Format > hide columns for this purposes
0
 

Author Comment

by:BBlu
ID: 34879563
Thanks, Capricorn.  It just turned out that I couldn't do it at the source level. I can hide them when the main form is in Form view, but setting the field view property to 'no' in design view of the subforms wasn't working.  And I was just trying to figure out why.  Thanks to everyone.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 34879568
Huh? I never mentioned any names - which in my case usually means I'm the subject ;-)
0
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 70 total points
ID: 34879686
in a2003, setting the visible property to Yes, hides the columm. but not in A2007
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 85 total points
ID: 34879784
@BBlu:

Not matter which method you use, no matter how you slice and dice it, short of deleting the columns ... if hidden and the user fools around enough with the mouse, the columns can be unhidden.

mx
0
 

Author Comment

by:BBlu
ID: 34881068
Sorry, Badotz.  I guess I took it personally.  A finance guy like myself can get pretty intimidated- or at least extremely impressed- inside this forum.  I continue to learn and grow from you all.  You all have a great rest of your weekend.
0
 

Author Closing Comment

by:BBlu
ID: 34881089
Thanks to all of you
0
 
LVL 29

Expert Comment

by:Badotz
ID: 34881479
No worries.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now