Hello All,
Hope all is well. I have a form I'm using for MS access to enter data into a table. All is working well but I've got some buttons on the form that aren't working as I want them too. What Id like to achieve is a save button which when pressed confirms the save which Ive currently got working with some VBA and then I'd like the users to be able to change the odd one or two fields and then hit save again and a new record be entered into the the table, but that isn't working, I also have a clear button and I've noticed that nothing actually saves into the table until after the clear button is pressed, which means total re-entering of every field.
As I say I have a save button, which has the VBA:
Code:
Private Sub Save_Record_Click()
Dim strMsg As String
Dim iResponse As Integer
' Specify the message to display.
strMsg = "Do you wish to save the changes?" & Chr(10)
strMsg = strMsg & "Click Yes to Save or No to Discard changes."
' Display the message box.
iResponse = MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?")
' Check the user's response.
If iResponse = vbNo Then
' Undo the change.
DoCmd.RunCommand acCmdUndo
' Cancel the update.
Cancel = True
End If
End Sub
and then a clear button which the "refresh form data" set from the wizard. Can anyone advise on what buttons I need in order to achieve what I want please?