UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Inputting A Number In A Form Control, Access 2010    
 
   
Alexander
post May 19 2017, 05:28 AM
Post#1



Posts: 3,338
Joined: 30-December 03
From: Glasgow, Scotland


Just puzzling why when I enter a number in a form control instead of say 1 it shows as 10.

If I input 2 it shows as 20 and so on...

I can delete the zero and move on but I need to watching carefully otherwise it accepts the wrong total.

The underlaying field is a Number .. Long Integer

Any points appreciated.


--------------------
Alexander
Keep using the sunscreen!
Go to the top of the page
 
bouncee
post May 19 2017, 06:20 AM
Post#2



Posts: 73
Joined: 5-August 05
From: Eastbourne, UK


Strange!

Is the control initially blank or is there a zero already (default)?

Is there an input mask? Or any code?

Can you enter value OK in table view?

If still a problem, could be corrupt database.
Go to the top of the page
 
GroverParkGeorge
post May 19 2017, 06:27 AM
Post#3


UA Admin
Posts: 30,461
Joined: 20-June 02
From: Newcastle, WA


Okay, so the number is initially multiplied by 10 when first entered? So if you enter 123, the result is 1230? Is there a before event running on this control?

--------------------
Go to the top of the page
 
Alexander
post May 19 2017, 06:33 AM
Post#4



Posts: 3,338
Joined: 30-December 03
From: Glasgow, Scotland


Hello Bouncee

The control has no events and is initially blank.

No mask and no code and I tried in the table view and all ok.

--------------------
Alexander
Keep using the sunscreen!
Go to the top of the page
 
Alexander
post May 19 2017, 06:34 AM
Post#5



Posts: 3,338
Joined: 30-December 03
From: Glasgow, Scotland


Yes George .. .. if I add 123 it shows 1230.

Again .. no events

--------------------
Alexander
Keep using the sunscreen!
Go to the top of the page
 
BruceM
post May 19 2017, 06:36 AM
Post#6


UtterAccess VIP
Posts: 6,830
Joined: 24-May 10
From: Downeast Maine


Does it also show 1230 in the table? What is the data type of the table field?
Go to the top of the page
 
Alexander
post May 19 2017, 06:39 AM
Post#7



Posts: 3,338
Joined: 30-December 03
From: Glasgow, Scotland


Hello Bruce and no because I always correct by deleting the end zero.

It's a number field and long integer.

I have just added a DEFAULT VALUE of ZERO (as kindly advised by Bouncee) and that is now working correctly.

--------------------
Alexander
Keep using the sunscreen!
Go to the top of the page
 
Alexander
post May 19 2017, 06:40 AM
Post#8



Posts: 3,338
Joined: 30-December 03
From: Glasgow, Scotland


Many Thanks Bouncee ... Default added as zero and working perfectly.

--------------------
Alexander
Keep using the sunscreen!
Go to the top of the page
 
bouncee
post May 19 2017, 06:41 AM
Post#9



Posts: 73
Joined: 5-August 05
From: Eastbourne, UK


Actually I didn't advise default of zero, surprised that did the trick!
Go to the top of the page
 
Alexander
post May 19 2017, 06:44 AM
Post#10



Posts: 3,338
Joined: 30-December 03
From: Glasgow, Scotland


Sorry Bouncee ....but you need to take the credit for pointing that out to me because it works and although have many examples in my application that have zero as default for some reason this one was overlooked.

A classic example of looking for a complex solution when the answer is simple and in front of you !!!!!


Thanks again.
This post has been edited by Alexander: May 19 2017, 06:45 AM

--------------------
Alexander
Keep using the sunscreen!
Go to the top of the page
 
BruceM
post May 19 2017, 06:54 AM
Post#11


UtterAccess VIP
Posts: 6,830
Joined: 24-May 10
From: Downeast Maine


QUOTE
I always correct by deleting the end zero.

Yes, but I was asking you what shows up in the table if you do not delete it.

I don't see why adding the default value 0 solved the problem. I can think of no reason that would work. Default value applies only to new records, and is overruled by data entry in that field.

BTW, sorry, I missed that you specified in your first post that it is a long integer field.

The first thing to try in a situation like this is often to delete the control and add a new one. It sounds like it is working, but again, there is no reason I can see why the default value would matter.
Go to the top of the page
 
Alexander
post May 19 2017, 06:57 AM
Post#12



Posts: 3,338
Joined: 30-December 03
From: Glasgow, Scotland


Many thanks Bruce

Yes ... I have deleted the Control and added again and defaulted to zero and working just fine.

--------------------
Alexander
Keep using the sunscreen!
Go to the top of the page
 
Alexander
post May 19 2017, 06:59 AM
Post#13



Posts: 3,338
Joined: 30-December 03
From: Glasgow, Scotland


I only applied the default to new records because I had manually corrected earlier entries.

Now the default will apply to all future new records, so I think that clears that up.

All sorted and many thanks.
This post has been edited by Alexander: May 19 2017, 06:59 AM

--------------------
Alexander
Keep using the sunscreen!
Go to the top of the page
 
GroverParkGeorge
post May 19 2017, 07:16 AM
Post#14


UA Admin
Posts: 30,461
Joined: 20-June 02
From: Newcastle, WA


We're glad to hear the immediate problem was resolved, but we're all left scratching our heads as to why it occurred in the first place. As Bruce pointed out, supplying a default value of 0 should NOT have made any difference at all. The fact that it did seem to resolve the problem is even more of a puzzler.

Still, if it's working correctly now, it may not be worth further investigation.

Continued success with your project.

--------------------
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    22nd September 2017 - 02:01 PM