Solved

Very basic GUI MS Access question.

Posted on 2013-12-06
14
474 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
[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
  • 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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…
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…

740 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