I have a form with a sub-form that works fine – up to a point.
The sub-form is a datasheet listing of cases that are assigned to a specific client. So far so good.
The sub-form has a button that will open the specific record(case) if clicked. NOT GOOD. In order to do this, I have to look for both the ‘client id’ and the ‘client case’ to insure that the correct record is opened.
The code I am trying to use is:
It does not open the correct record.
Anyone able to give me some guidance here?
Thanks.
Harry Jessen
HMJessen@Yahoo.com
The sub-form is a datasheet listing of cases that are assigned to a specific client. So far so good.
The sub-form has a button that will open the specific record(case) if clicked. NOT GOOD. In order to do this, I have to look for both the ‘client id’ and the ‘client case’ to insure that the correct record is opened.
The code I am trying to use is:
Code:
Private Sub Details_Click()
On Error GoTo Err_Details_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Client Case Details"
stLinkCriteria = "[Client No]=" & "'" & Me![Client No] & "'" 'And' "[Client Case]=" & "'" & Me![Client Case] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Details_Click:
Exit Sub
Err_Details_Click:
MsgBox Err.Description
Resume Exit_Details_Click
End Sub
Anyone able to give me some guidance here?
Thanks.
Harry Jessen
HMJessen@Yahoo.com