Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Feb 2003
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    change field value with command button (2003)

    I have a command button on my form that duplicates the record I'm in. What I'd also like to do when I duplicate a record is change one of my fields which is a combo box with the choices "Original" or "Duplicate." I have the default set to Original but when I duplicate, I'd like that to change. Can anyone help me with the code, and where should I put it, right after the code to duplicate record? Thanks.

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

    Re: change field value with command button (2003)

    Yes, you should insert an instruction to set the value to Duplicate immediately below the instruction that duplicates the record. If the combo box is bound to a text field, use

    Me.ComboBoxName = "Duplicate"

    If, however, the combo box is bound to a number field, with for example 1 = Original, 2 = Duplicate, you must use the numeric value, without quotes:

    Me.ComboBoxName = 2

    Replace ComboBoxName with the name of your combo box, and in the second example, 2 with the appropriate value.

  3. #3
    Star Lounger
    Join Date
    Feb 2003
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: change field value with command button (2003)

    Thanks. I almost had it right.

Posting Permissions

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