Results 1 to 3 of 3
  1. #1
    Perimeter is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    11

    Help building a command button to save the record, but keep some data for next record

    Hello,



    I have a form with a dozen fields, and a save button "Save Button" that saves the record and clears the form - works awesome.
    I would like another save button "Enter Next" that saves the record but keeps the current data for fields A, B, and C and clears the rest of the form.

    As always thank you all for your time!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,526
    Code:
    sub btnSave2_click()
    dim vVal1, vVal2, vVal3
    
    'hold your special data
    vVal1 = txtBox1
    vVal2 = txtBox2
    vVal3 = txtBox3
    
    'save data
    DoCmd.RunCommand (acCmdSaveRecord)
    
    'clear the fields
    ==== PUT YOUR CLEAR FIELDS CODE HERE
    
    'reload special data
    txtBox1 = vVal1
    txtBox2 = vVal2
    txtBox3 = vVal3
    end sub

  3. #3
    Perimeter is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    11
    That worked... beautifully!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 04-07-2022, 02:56 PM
  2. Replies: 3
    Last Post: 12-08-2014, 05:35 PM
  3. Replies: 3
    Last Post: 10-04-2013, 06:24 AM
  4. Help Me! Save Record Command Button issue
    By gszdwml in forum Programming
    Replies: 1
    Last Post: 04-24-2012, 09:53 AM
  5. Replies: 4
    Last Post: 07-22-2011, 12:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums