Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2009

    Unanswered: Simple save button help

    I've got a simple form with a combo box, unbound text boxes and a save button. If the text boxes are updated, I want to save it to the table using the save command button.

    The below code is running, but the table it not getting updated. I've surely got to be missing somehting obvious?!? I've attached the small project to help troubleshoot.

    Private Sub cmdSave_Click()
    On Error GoTo Err_cmdSave_Click

    Dim strMsg As String, strTitle As String

    strMsg = "Do You Want To Save This Record?"
    strTitle = " Save Record ?"

    If MsgBox(strMsg, vbQuestion + vbYesNo, strTitle) = vbNo Then

    End If

    DoCmd.GoToRecord , , acNewRec

    Exit Sub

    MsgBox Err.Description
    Resume Exit_cmdSave_Click

    End Sub
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2004
    Chicago, IL
    If you have unbound text boxes you need to tell Access where to put the information the user entered. You will need to run some SQL to update the table you want to update with the data that the user entered. You probably want to create an Append query, but there are several questions you need to answer:

    1. Are you always going to append new data?
    2. Do you need to check to make sure you don't have duplicates?
    3. How will the user edit existing records?

Posting Permissions

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