Hi Experts,
Per Access 2007 form wizard, I create a form to enter data with save button. I saw a default marco code for save button.
line 1. action OnError and arguments as next,
line 2. action as runCOmmand and arguments as savecord
line 3. condition as [MarcroError]<>0 ; the action as MsgBox in below additional 4 lines as
line 4. action as GoTo record and argumemtt as ,,Next,
Meaasge: the data have been saved. Thanks
Beep: Yes
type: information
title: Access database
When I clicked save button. the data have been saved in table But message box does not work. the data is still in fields that confused users.
The some person suggestion to build VBS code on save button click event. I did as below
On Error GoTo Err_dbg
DoCmd.SaveRecord , , acNewRec
MsgBox UCase("Data was successfully added " & vbNewLine & vbNewLine & vbCrLf & " Thanks!")
DoCmd.GoToRecord , , acNewRec
Err_dbg:
MsgBox " Error No: " & Err.Number & "; Description: " & Err.Description & vbNewLine & "Please debug"
but I receive a compile error: method or data number not found. clicked OK button yellow color focus on DoCmd.SaveRecord , , acNewRec
I am new access person in here. hope I can got an example.
Thanks
newaccess