Gasman
Enthusiastic Amateur
- Local time
- Today, 11:22
- Joined
- Sep 21, 2011
- Messages
- 16,597
Hi all,
I have a form Clients, that has a button on it to add related Transfer records.
It opens the form in Add Mode by supplying the ClientID in Openargs and in the target form I have in the Load event
I have another button at present which will open same form, but filtered for the clientID with
How could I enable one button to work in both modes?. What is the 'accepted' way to do this please?
TIA
I have a form Clients, that has a button on it to add related Transfer records.
It opens the form in Add Mode by supplying the ClientID in Openargs and in the target form I have in the Load event
Code:
Private Sub Form_Load()
If Not IsNull(Me.OpenArgs) Then ' Passing in the client ID means we want a new record.
DoCmd.GoToRecord , , acNewRec
Me.ClientID = Me.OpenArgs
End If
End Sub
Code:
Private Sub cmdTransfers_Click()
DoCmd.OpenForm "frmTransfer", , , "ClientID = " & Me.ClientID, , acDialog
End Sub
How could I enable one button to work in both modes?. What is the 'accepted' way to do this please?
TIA