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

    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
    Me.Undo

    End If

    DoCmd.GoToRecord , , acNewRec

    Exit_cmdSave_Click:
    Exit Sub

    Err_cmdSave_Click:
    MsgBox Err.Description
    Resume Exit_cmdSave_Click

    End Sub
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    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
  •