Bob,
You can't enter "12-2" into a numeric field, it's a violation of data
types.
You'll have to accept the value in an unbound field (ex name
[TempNumFld], convert that value to the one you want to store, and update
NumFld accordingly.
I want easy price entry into my Access table, so I want to enter 12-2 and
have Access store that in the table as 12.50.
On the After Update of [TempNumFld]...
Private Sub TempNumFld_AfterUpdate()
NumFld = Val(Left(Test1, InStr(Test1, "-") - 1) + Mid(Test1, InStr(Test1,
"-") + 1) * 0.25)
End Sub
I tested this and it's OK. When you put 12-1 into TempNumFld, it's coverted
to 12.25 and stored in NumFld
hth
Al Camp
Bob said:
Al,
A hypothetical example: Assume that Microsoft is traded on NASDAQ in
quarters. That is, the minimum price change is 25cents. This isn't how it
is,
but let's assume it is!
I want easy price entry into my Access table, so I want to enter 12-2 and
have Access store that in the table as 12.50.
AlCamp said:
Bob,
I'm confused... let's start over...
Given your numeric field (ex.name of [NumFld] and a value of 12.25)
1. What value do you want to enter into the field on your form?
(12.1
or 12.25?)
2. How do you want that value stored in the table? (as 12.25, or
as
12.1?)
(Can't do "12-1" in a numeric field)
3. How do you want to display the value? ("12-1"?)
Answer me that... and I'll try to get right back.
hth
Al Camp