Solved

Very basic GUI MS Access question.

Posted on 2013-12-06
14
431 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

759 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

18 Experts available now in Live!

Get 1:1 Help Now