Solved

Very basic GUI MS Access question.

Posted on 2013-12-06
14
482 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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.

630 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