T
Tony Williams
First off I'm a bit of a newbie at Access, most of what I've learned is from
books and from you guys on here.
I have a database that I would like to create a custom menu bar. I've looked
at the help files and it appears that the actions behind the menu items can
be macros. However I have eg code behind a Save button on a form that I want
to put behind the Save menu item. Can I do this? If so can someone point in
1,2, 3 steps where I can find some good tutorial or give me any pointers.For
example how would I rewrite this code which is behind my Save button to work
behind the File-Save option on a customised menu bar:
Private Sub cmdsave_Click()
On Error GoTo Err_cmdsave_Click
If Me.NewRecord Then
If vbNo = MsgBox("Are you sure you want to save this record?", 36, "Enter
New Record") Then
Me.Undo
[DocNametxt].SetFocus
End If
End If
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_cmdsave_Click:
Exit Sub
Err_cmdsave_Click:
MsgBox Err.Description
Resume Exit_cmdsave_Click
End Sub
TIA
Tony Williams
books and from you guys on here.
I have a database that I would like to create a custom menu bar. I've looked
at the help files and it appears that the actions behind the menu items can
be macros. However I have eg code behind a Save button on a form that I want
to put behind the Save menu item. Can I do this? If so can someone point in
1,2, 3 steps where I can find some good tutorial or give me any pointers.For
example how would I rewrite this code which is behind my Save button to work
behind the File-Save option on a customised menu bar:
Private Sub cmdsave_Click()
On Error GoTo Err_cmdsave_Click
If Me.NewRecord Then
If vbNo = MsgBox("Are you sure you want to save this record?", 36, "Enter
New Record") Then
Me.Undo
[DocNametxt].SetFocus
End If
End If
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_cmdsave_Click:
Exit Sub
Err_cmdsave_Click:
MsgBox Err.Description
Resume Exit_cmdsave_Click
End Sub
TIA
Tony Williams