Results 1 to 5 of 5
  1. #1
    athyeh is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    170

    Creating a "Submit" button

    Hello,

    I am creating a form and want this form to have a "Submit" button that:

    1) "Saves" the information the user was inputting to a record
    2) Creates a new record for input
    3) Clears the form for the inputter

    http://answers.microsoft.com/en-us/o...b-68b599b31bf5



    I want to do this.

    But I cannot get this to work....

    Please help.

    Thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Record entry/edit on a bound form is committed to table when move to another record, close form, or run code.

    All you have to do to save record and 'clear' the form is move to a new record. This can be done with the intrinsic Access navigation feature or with code (macro or VBA) behind a button.

    Why doesn't it work - error message, wrong results, nothing happens?

    Post attempted code for analysis.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    athyeh is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    170
    Hello,

    Thank you for your reply. The code I currently have in my button is:
    Private Sub Command24_Click()
    RunCommand acCmdSaveRecord
    Me.Requery
    End Sub

    I understand that but the inputters of this form are even less tech-savvy then I am and I just want to be able to have them into this form with as minimal explanation/instruction as possible.

    When I click this button: Nothing Happens. No error message, wrong results, nothing.

    Is it important to note that on this form that I have also included several dropdown menus, using LookUp Wizard with relationships to other tables?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Is the record committed to table? That could happen and you would not really 'see' anything.

    Try instead:

    Private Sub Command24_Click()
    DoCmd.GoToRecord , , acNewRec
    End Sub
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    athyeh is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    170
    Thank you.

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

Similar Threads

  1. Creating "New" Button using VBA in MS Access??
    By MarcoRed in forum Programming
    Replies: 2
    Last Post: 09-16-2012, 10:05 AM
  2. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  3. Replies: 2
    Last Post: 02-21-2012, 01:35 PM
  4. Replies: 0
    Last Post: 01-11-2012, 12:34 PM
  5. Replies: 3
    Last Post: 02-23-2010, 06:32 PM

Tags for this Thread

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