C
CW
I want a form to open in Add mode. I understand that I need to add acFormAdd
but I'm not sure whereabouts it should go in the existing command button code
- I've tried several places but without success - advice needed please!
Below is my existing code - where should I put acFormAdd?
Many thanks
CW
Private Sub cmdInvHeaderForm_Click()
On Error GoTo Err_cmdInvHeaderForm_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmInvoiceHeader"
stLinkCriteria = "[Ref]=" & Me![Ref]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms!frmInvoiceHeader.Ref = Forms!Main.Ref
Exit_cmdInvHeaderForm_Click:
Exit Sub
Err_cmdInvHeaderForm_Click:
MsgBox Err.Description
Resume Exit_cmdInvHeaderForm_Click
End Sub
but I'm not sure whereabouts it should go in the existing command button code
- I've tried several places but without success - advice needed please!
Below is my existing code - where should I put acFormAdd?
Many thanks
CW
Private Sub cmdInvHeaderForm_Click()
On Error GoTo Err_cmdInvHeaderForm_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmInvoiceHeader"
stLinkCriteria = "[Ref]=" & Me![Ref]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms!frmInvoiceHeader.Ref = Forms!Main.Ref
Exit_cmdInvHeaderForm_Click:
Exit Sub
Err_cmdInvHeaderForm_Click:
MsgBox Err.Description
Resume Exit_cmdInvHeaderForm_Click
End Sub