Solved

Very basic GUI MS Access question.

Posted on 2013-12-06
14
457 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

777 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