displaying the correct value

  • Thread starter Thread starter Rani
  • Start date Start date
R

Rani

Hi guys, I have two minor issue which drive me nuts:

A. I need to represent the 10th part of a number AKA the user enters 28 and
the computer should display 0.28 I was using an afterupdate event :
Me.PaymentAddKM = Me.PaymentAddKM / 100, but I am not getting anything out
of it.

B. I have 2 CBX's on my form, how do I cause them to change the default
value when I go to a new record ?
if I select them they are showed as selected.

thanks
 
A. I need to represent the 10th part
of a number AKA the user enters 28 and
the computer should display 0.28 I was
using an afterupdate event :
Me.PaymentAddKM = Me.PaymentAddKM / 100,
but I am not getting anything out of it.

Do you, indeed, want the tenth part, as you write, or the hundredth part, as
you illustrate? In either case, do you want to store exactly what was
entered but _show_ the reduced value? If so, simply put a label in front of
your Text Box containing the ".". If you want to both show and store it,
then allow entry into an _unbound_ Text Box, put your code in its
AfterUpdate, but save the result in a TextBox bound to the field where you
want to save it (can have its Visible property set to No) _and_ save it back
into the unbound field.

Frankly, I'd find that more than a little confusing if I were a user -- I
type in something and it displays something else.
B. I have 2 CBX's on my form, how do
I cause them to change the default
value when I go to a new record ?

"CBX" = Combo Box? "New record" really meaning _new_ record, or just a
different existing record? In the latter case, it would be unbound Combo
Boxes, and you'd put code in the OnCurrent event to set the value to what
you want. In the former, if it is a bound Combo Box, each new record will
show the Default Value; if it is an unbound Combo Box, then you'll need code
in OnCurrent, again (you may or may not, depending on your needs, test for
New Record).

You'd make it a lot easier to answer your questions if you'd be both precise
and concise in asking them.

Larry Linson
Microsoft Access MVP
 
Larry
you are right I think I came somewhat waged in the previous massage so let
me try to clear out things.
let us start with the second issue,
I have a form within I have few unbound CBX (combo Boxes) after selecting a
CBX a new field is appearing on the screen after finishing entering data and
clicking on a new record button:
On Error GoTo Err_AddNewRec_Click
DoCmd.GoToRecord , , acNewRec
Exit_AddNewRec_Click:
Exit Sub
Err_AddNewRec_Click:
MsgBox Err.Description
Resume Exit_AddNewRec_Click

the CBX on selection field stays open., how do I prevent it from happening ?

as for the first issue, maybe you can suggest of a method.
I need to represent the tenth or the hundred part - based on user selection
(and it might be a whole number) what is the best way for doing so ?
 
Back
Top