Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    I would like to have a button call "ReInput" on the form to let user to delete all current data fields on the form, then user can reinput if they want. However, I couldn't find a best codes to give to me what I want.

    Thanks in advance.

    Regards,

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='garyfei' post='768099' date='29-Mar-2009 16:44'][/quote]
    If I understand correctly your question, you should have two buttons. One to store all the data from the form and delete the record. he other button would be used to re-input the data on a existing or new form.
    Is it that what you want ?
    If yes, then use code for button 1 like this :
    MyVariable1 = Me.Textbox1
    MyVariable2 = Me.Textbox2
    MyVariable3 = Me.Textbox3
    ...
    DoCmd.RunCommand acCmdDeleteRecord

    and for button 2
    Me.textbox1 = MyVariable1
    Me.textbox2 = MyVariable2
    Me.textbox3 = MyVariable3
    ...

    Variables should be declared at the top of the code so you can use them in both sub's.
    Francois

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    [quote name='garyfei' post='768099' date='30-Mar-2009 01:44']Hi,

    I would like to have a button call "ReInput" on the form to let user to delete all current data fields on the form, then user can reinput if they want. However, I couldn't find a best codes to give to me what I want.

    Thanks in advance.

    Regards,[/quote]
    Is the form bound to a table or query?
    If so why not just execute:
    Me.UnDo
    this clears all the fields on the form.

Posting Permissions

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