Save n Refresh New Form

  • Thread starter Vesta via AccessMonster.com
  • Start date
V

Vesta via AccessMonster.com

Hi All,

I have use the 'Save' command button in the access2000.
However, I need additional function when I click the 'Save' button.
Click 'Save' -
'Yes' --> Save the data
and then refresh into new form with the Log Number(Primary
Key) increase to the next number
No issue on the 'No' function.
Pls help.
Thank you.

Private Sub SaveData_Click()
On Error GoTo Err_SaveData_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_SaveData_Click:

Exit Sub

Err_SaveData_Click:
MsgBox Err.Description
Resume Exit_SaveData_Click

End Sub
 
J

John W. Vinson

I have use the 'Save' command button in the access2000.
However, I need additional function when I click the 'Save' button.
Click 'Save' -
'Yes' --> Save the data
and then refresh into new form with the Log Number(Primary
Key) increase to the next number

The Form Wizard is using really old, obsolete toolbar code. There are better
ways!

Try

Private Sub cmdSave_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.GoToRecord acDataForm, Me.Name
End Sub

This assumes that the Log Number is an Autonumber field - if it's not post
back, and explain what you want to happen (in particular what you want to
happen when the user is done entering data!)
No issue on the 'No' function.

I have no idea what you're talking about here.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top