Solved

Can't get fields to display on datasheet view form

Posted on 2014-11-09
1
173 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
[X]
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

by:
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

/gustav
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

707 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