Solved

Can't get fields to display on datasheet view form

Posted on 2014-11-09
1
166 Views
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.  

??

Steve
0
Comment
Question by:SteveL13
1 Comment
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 total points
Comment Utility
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

/gustav
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

762 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

10 Experts available now in Live!

Get 1:1 Help Now