Representing the correct value of a field.

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

Rani

Hi guys,

I have two minor issues that drives me crazy.

the first one is:

I have a field A in which I need to present the value of a number (that
represents money) in cents AKA the user enters 28 and the right display
should be 0.28. how do I do that ?

the second issue is that I have few checkboxes on the form and while going
to the new record the checkboxes are not being erased while going to the new
record.

how do i solve it.
 
Hi guys,

I have two minor issues that drives me crazy.

the first one is:

I have a field A in which I need to present the value of a number (that
represents money) in cents AKA the user enters 28 and the right display
should be 0.28. how do I do that ?

Divide the value by 100 in the AfterUpdate event of the textbox:

Private Sub txtMoney_AfterUpdate()
If Me!txtMoney >= 1.00 Then
Me!txtMoney = Me!txtMoney / 100
End If
End Sub

The IF test is because the user might edit an existing value: if there
is 0.27 in the field and the user edits it to 0.28, it could end up as
..0028! If the user can legitimately enter 128 for $1.28, or (worse)
100 for $1.00 you'll need a more sophisticated test.
the second issue is that I have few checkboxes on the form and while going
to the new record the checkboxes are not being erased while going to the new
record.

Are these bound to fields in your table? If so, they should be
blanking out on their own; if not, what function do they serve? You
could set their Default property to FALSE to blank them out on a new
record.
 
Back
Top