Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Currency Fields (WXP Access 2000)

    I noticed that my formula for summing several currency field controls (e.g. =Field1+Field2, etc.) came up blank if even one of the fields had nothing in it, i.e. a Null. I then changed the default value to zero, so the fields all initialize to $0. However, when I tab into one of these controls and enter an amount, I get an error message about incorrect data. I discovered that I first had to erase (or highlight) the $0 amount and then enter the new amount. Is there some way to avoid this problem? It is very annoying.

    It looks lilke what needs to be done is to have the program select (highlight) the current amount upon entering the control, then whatever you type replaces what's there.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Currency Fields (WXP Access 2000)

    Chuck,

    If you select Tools | Options..., and activate the Keyboard tab, you'll see a fram with caption "Behavior Entering Field". If you select the first option (Entire Field or Whole Field, I don't know the exact label in English), you'll get the behavior you want.

    Alternatively, you can leave the Default Value property blank, and use an expression like

    =Nz([Field1],0)+Nz([Field2],0)

    The Nz function replaces null values in the first argument with the value specified in the second argument.

  3. #3
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Currency Fields (WXP Access 2000)

    Hi Hans,

    The problem seems to have gone away on its own! I don't know what I did, as I was haveing trouble with the Tab Order again (it wouldn't retain the order I set). I think I must have exited the program and restarted or something like that, and the tab order started working. I then noticed that the entire field was selected upon entry.

    I did check the Keyboard settings and I have the "Select Entire Field" option selected.

    The Null vs. zero length string property in VBA is a very subtle problem. I had to go back to Helen Feddema's book to research that one.

    Thanks for your help.

Posting Permissions

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