G
Guest
I have a problem with a form when opening. Normally a job form opens gives a
contractID number and then opens the parent form. If this is done in a Macro
it works, I converted the Macro to Code and it creates the record but opens
the form on the next record which is empty. The code is:
Private Sub PO_AfterUpdate()
'Createjobnew
Dim tmp As String
SendKeys "{f9}", True
DoCmd.OpenForm "parent", acNormal, "", "[id]=[Forms]![Job
No]![contractid]", acEdit, acNormal
DoCmd.RunMacro "openjobslemail", , "" 'this sends out emails
DoCmd.Close acForm, "Job No"
End Sub
Any help is appreciated.
Thanks
contractID number and then opens the parent form. If this is done in a Macro
it works, I converted the Macro to Code and it creates the record but opens
the form on the next record which is empty. The code is:
Private Sub PO_AfterUpdate()
'Createjobnew
Dim tmp As String
SendKeys "{f9}", True
DoCmd.OpenForm "parent", acNormal, "", "[id]=[Forms]![Job
No]![contractid]", acEdit, acNormal
DoCmd.RunMacro "openjobslemail", , "" 'this sends out emails
DoCmd.Close acForm, "Job No"
End Sub
Any help is appreciated.
Thanks