How do I code for a button in one form to do the funtion in anothe

G

Guest

I have two forms: Work Order Form and a Navigation Form. The Navigation
form has the buttons, such as "Print Current Job", "Delete Current Job", Etc.

The problem is that the functions apply to the Navigation Form and not the
Work Orcer Form.

How do I change the code for the buttons to apply to the other form?

Here is an example of the code:

Private Sub Delete_Current_Job_Click()
On Error GoTo Err_Delete_Current_Job_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_Delete_Current_Job_Click:
Exit Sub

Err_Delete_Current_Job_Click:
MsgBox Err.Description
Resume Exit_Delete_Current_Job_Click

End Sub
 
A

Allen Browne

You could have the code set focus to the other form:
Forms("Work Order Form").SetFocus
RunCommand acCmdDeleteRecord
 

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