Solved

Very basic GUI MS Access question.

Posted on 2013-12-06
14
443 Views
Last Modified: 2013-12-07
I seem to forget some fine GUI details of MS Access basic forms.
I use "#.0" format for my input (human body temperature; so I do not want 98.314159).
This format displays what I need but in some cases it displays ".0" string inappropriately, and that annoyingly inhibits number typing.
Is there any way to
1) type the value without any messing untyped characters, whether mouse is used or not.
2) display result in the defined format after field typing is complete (with, say, <Enter>).
Please see the attached image for details.
Thanks.
PS: I am not a rookie, just forgot :-(
Untitled.png
0
Comment
Question by:midfde
  • 5
  • 5
  • 3
  • +1
14 Comments
 
LVL 21

Expert Comment

by:mastoo
ID: 39701878
Try #.#
0
 
LVL 1

Author Comment

by:midfde
ID: 39701897
All the same.
I forgot to mention that 98 should display as "98.0", i.e. with ".0"
0
 
LVL 8

Expert Comment

by:Emil_Gray
ID: 39702081
In the After Update use this:

 Format(Round([yourfield],1),"#.0")
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39702107
The format string you posted is working consistently for me in Access 2010, datasheet view, regardless of whether I tab or mouse click on the field.   The trailing zero does not show up unless either I put it there intentionally, or I move away from the field (it updates with a trailing zero)

Do you have any Current Event code for example, that does any kind of manipulation on the new record - populating other fields, etc?
0
 
LVL 8

Expert Comment

by:Emil_Gray
ID: 39702136
Can you attach a db with sample data for your table, form and query for the form?
0
 
LVL 8

Expert Comment

by:Emil_Gray
ID: 39702170
You might want to read the information presented in this other thread regarding trailing zeros. http://www.access-programmers.co.uk/forums/showthread.php?t=176425
0
 
LVL 1

Author Comment

by:midfde
ID: 39702422
Ok, eeTemp.accdb is attached.
Access AbouteeTemp.accdb
0
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)

 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39702490
The default value of zero in your table design is causing this problem...

So the workaround if you must have it default to zero is to remove the default setting at the table level and handle it at the form level with code in the after update event of the textbox to force it to zero if it is null.
0
 
LVL 1

Author Closing Comment

by:midfde
ID: 39702519
Thanks, mbizup. Could you please formulate the feature that you (and I) discovered? Is it an MS Access bug (I know: "No way, just undocumented!") ?
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39702531
Oddly -- annoying as it is from a UI and a developer standpoint, I don't think MS would qualify that as a bug.

Having a default value is having the field prepopulated for you in the desired format... so it is doing exactly what you are telling it to do.

This is more apparent if you enter data directly into the table without using a form interface.  You'll see the .0 there before you even start entering data into the new record.

A form is slower to respond, but try entering data in a new record, in any of the other fields before entering data in the input field.  You'll see that .0 pop up as soon as you give a value to any field in that new record.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39702532
So you could handle that in either of two ways, I guess...

1.  drop the table level default

or

2.  set the format in the after update event, so that the default value isn't subject to the formatting.
0
 
LVL 1

Author Comment

by:midfde
ID: 39702554
Well, what is the difference from you point of view between upper and lower pictures in my original message attached image.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39702664
I'm not sure what the exact steps you followed to get the screenshots were, but this is what I noticed entering data myself:

 - In NEW records, I consistently saw the .0  
 - In existing records I consistently did NOT see the .0 when editing data

In a new record, the formatted default value automatically (and rather suddenly) appears as soon as you start entering data in any field... which of course is annoying if the first item you enter is in the "input" field.

With editing existing records (which I think is what your first picture shows), you don't get the .0 popping up because the default value only applies to new records.  So when you start typing data in the Input field of an existing record, you are overwriting/blanking out the existing data, versus triggering the formatted default value to appear.

So annoying from a UI perspective -- yes....... but a bug -- probably not.
0
 
LVL 1

Author Comment

by:midfde
ID: 39702980
>>I'm not sure...
Have you read about "Press <tab>..." there?Tab-Tab-Tab...Are "annoying" undocumented feature (BTW, what is it?)  and a bug both synonyms?

Thanks for the discussion anyway.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

910 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

22 Experts available now in Live!

Get 1:1 Help Now