S
sue gray
I have a command button on a form that I am trying to use to open a blank
form based upon clientid. When I test the form and use the command button it
brings up all the notes for all clients.
Private Sub cmdAddContactNote_Click()
' This code adds a new contact note based on client id.
On Error GoTo Err_cmdAddContactNote_Click
Dim strDocName As String
strDocName = "frmcontactnote"
' Open Contact Note form in data entry mode and store ClientID in
' the form's OpenArgs property.
DoCmd.OpenForm strDocName, , , , acAdd, , Me!clientid
If IsNull(Forms!frmcontactnote!clientid) Then
Forms!frmcontactnote!clientid = Me!clientid
Forms!frmcontactnote!ContactType.SetFocus
End If
Exit_cmdAddContactNote_Click:
Exit Sub
Err_cmdAddContactNote_Click:
MsgBox Err.Description
Resume Exit_cmdAddContactNote_Click
End Sub
I have tried to find the mistake, I put msgbox me!clientid after the docmd.
It shows I have the correct client.
Thanks for any help
form based upon clientid. When I test the form and use the command button it
brings up all the notes for all clients.
Private Sub cmdAddContactNote_Click()
' This code adds a new contact note based on client id.
On Error GoTo Err_cmdAddContactNote_Click
Dim strDocName As String
strDocName = "frmcontactnote"
' Open Contact Note form in data entry mode and store ClientID in
' the form's OpenArgs property.
DoCmd.OpenForm strDocName, , , , acAdd, , Me!clientid
If IsNull(Forms!frmcontactnote!clientid) Then
Forms!frmcontactnote!clientid = Me!clientid
Forms!frmcontactnote!ContactType.SetFocus
End If
Exit_cmdAddContactNote_Click:
Exit Sub
Err_cmdAddContactNote_Click:
MsgBox Err.Description
Resume Exit_cmdAddContactNote_Click
End Sub
I have tried to find the mistake, I put msgbox me!clientid after the docmd.
It shows I have the correct client.
Thanks for any help