Results 1 to 2 of 2
  1. #1
    cgschlangen
    Guest

    Percents problem (Access 2000)

    Hello all - I have a column in my table that is a number field set to Percent. When I enter 50 and tab across the field is automatically changed to 5000% It always does this unless I enter a % after 50...
    Any ideas on how to keep this from happening? I'm stumped...
    Thanks
    Dan

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Percents problem (Access 2000)

    Percentages are just a way of representing decimals, so 50 is treated as 50.0 which is 5000%.

    If you enter .5 it will be treated as 50%.

    Another option is to create an afterupdate event that divides what you enter by 100.

    <pre>Private Sub percentfield_AfterUpdate()
    If Me!percentfield > 1 Then
    Me!percentfield = Me!percentfield / 100
    End If
    End Sub
    </pre>

    Regards
    John



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •