heavenbound4life
New member
- Local time
- Today, 11:38
- Joined
- Dec 14, 2012
- Messages
- 22
Hello everyone, I have very little knowledge of VBA. Please, how can I make the code below run automatically after clicking a button with macro command? What I wanted is running the VBA code automatically after the macro must have completed its job. Thank you.
Code:
Private Sub cmdStrt_Click()
With CodeContextObject
On Error Resume Next
DoCmd.GoToRecord , "", acNewRec
If (.MacroError <> 0) Then
Beep
MsgBox .MacroError.Description, vbOKOnly, ""
End If
End With
Me.InvoiceDate.Value = Format(Date, "dd-mmm-yyyy")
Me.Employee.Value = Format([TempVars]![CurrentUser])
If Not IsNull(Me.InvoiceDate) Then
Me![frmSubformSales].Form.ItemID.Enabled = True
Me![frmSubformSales].Form.Quantity.Enabled = True
End If
End Sub
Last edited: