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
Solved

Can't get fields to display on datasheet view form

Posted on 2014-11-09
1
170 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
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

856 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