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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
LVL 50

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

749 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