Revert back to Default Value

Discussion in 'Microsoft Access Form Coding' started by jas580, May 13, 2009.

  1. jas580

    jas580 Guest

    Hello,

    On a form, I have an unbound text box with a default value of 2. While in
    form view, I can change the value of the text box. Now I want to create a
    button on the form that, when clicked, will change the text box value back to
    its default. Thanks for the help...

    -jeff
     
    jas580, May 13, 2009
    #1
    1. Advertisements

  2. jas580

    KLZA Guest

    On May 13, 4:03 pm, jas580 <> wrote:
    > Hello,
    >
    > On a form, I have an unbound text box with a default value of 2.  Whilein
    > form view, I can change the value of the text box.  Now I want to create a
    > button on the form that, when clicked, will change the text box value back to
    > its default.  Thanks for the help...
    >
    > -jeff


    use onclick event..Assuming your unbound text box is calle text0 and
    button is called command2 use the follwing code.

    Private Sub Command2_Click()
    Text0 = 2
    End Sub
     
    KLZA, May 13, 2009
    #2
    1. Advertisements

  3. jas580

    sfisher973 Guest

    A little more generic...

    Private Sub Command2_Click()
    Text0 = Text0.default
    End Sub

    --
    -Steve


    "KLZA" wrote:

    > On May 13, 4:03 pm, jas580 <> wrote:
    > > Hello,
    > >
    > > On a form, I have an unbound text box with a default value of 2. While in
    > > form view, I can change the value of the text box. Now I want to create a
    > > button on the form that, when clicked, will change the text box value back to
    > > its default. Thanks for the help...
    > >
    > > -jeff

    >
    > use onclick event..Assuming your unbound text box is calle text0 and
    > button is called command2 use the follwing code.
    >
    > Private Sub Command2_Click()
    > Text0 = 2
    > End Sub
    >
     
    sfisher973, May 13, 2009
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    1
    Views:
    208
    Rod Scoullar
    Feb 19, 2004
  2. Geordie

    Default value in combo box = value of another combo box?

    Geordie, Mar 16, 2004, in forum: Microsoft Access Form Coding
    Replies:
    1
    Views:
    370
  3. Degger

    Making the last value entered the default value in a combo box

    Degger, Oct 2, 2004, in forum: Microsoft Access Form Coding
    Replies:
    1
    Views:
    230
    Marshall Barton
    Oct 2, 2004
  4. Guest

    Change row source in vba, and later revert to original

    Guest, Dec 3, 2006, in forum: Microsoft Access Form Coding
    Replies:
    1
    Views:
    923
    Guest
    Dec 3, 2006
  5. DavisGail

    revert back to last value

    DavisGail, Oct 12, 2009, in forum: Microsoft Access Form Coding
    Replies:
    5
    Views:
    235
    Jeff Boyce
    Oct 12, 2009
Loading...

Share This Page