Can't get fields to display on datasheet view form

Posted on 2014-11-09
Last Modified: 2014-11-10
I tried to change the display widths of two fields on a datasheet view form using...

Private Sub Form_Load()

    Const TWIPSTOINCHES = 1440
    Me.txtID.ColumnWidth = TWIPSTOINCHES * 0
    Me.txtActualServiceStartDate.ColumnWidth = TWIPSTOINCHES * 1
    Me.txtActualServiceStopDate.ColumnWidth = TWIPSTOINCHES * 1

End Sub

Open in new window

Then when I launched the form the fields did not display at all.  Then I changed the code to...

Private Sub Form_Load()

    Const TWIPSTOINCHES = 1440
    Me.txtID.ColumnWidth = TWIPSTOINCHES * 0
'    Me.txtActualServiceStartDate.ColumnWidth = TWIPSTOINCHES * 3
'    Me.txtActualServiceStopDate.ColumnWidth = TWIPSTOINCHES * 3

End Sub

Open in new window

And now the fields still won't display.  


Question by:SteveL13
1 Comment
LVL 49

Accepted Solution

Gustav Brock earned 500 total points
ID: 40431389
That's because when you set ColumnWidth = 0, then ColumnHidden is set to True.
However, when you set ColumnWidth to some value, then ColumnHidden is still True.

So you may need:

    Me!txtActualServiceStartDate.ColumnWidth = TWIPSTOINCHES * 1
    Me!txtActualServiceStopDate.ColumnWidth = TWIPSTOINCHES * 1
    If TWIPSTOINCHES * 1 > 0 Then
        Me!txtActualServiceStartDate.ColumnHidden = False
        Me!txtActualServiceStopDate.ColumnHidden = False
    End If


Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
unable to save new report from old one 9 27
How to use DLookup with IsNull Function 4 22
VBA SQL statement - 2 "OR"s and 1 "And" 4 25
backup programme - VBA 3 22
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

813 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

11 Experts available now in Live!

Get 1:1 Help Now