G
Guest
Hi all,
I got a code to open 1 of 2 possible forms on the double click event of a
text field.
I dont see where the problem lies. When i try to double click the field it
simply says "MS Access cannot find the field "|" referred to in your
expression". I dont have any field called "|". [ID] & [Type] fields are
numbers. Where it went wrong?
Can anybody help please? I paste the code below.
Thank you.
Lana
Private Sub Subject1_DblClick(Cancel As Integer)
On Error GoTo Err_Subject1_DblClick
Dim stDocName As String
Dim stLinkCriteria As String
Select Case True
Case (Nz([tCorrespondence].[Type], 0) = 1)
stDocName = "CorrIncoming"
Case (Nz([tCorrespondence].[Type], 0) = 2)
stDocName = "CorrOutgoing"
Case Else
End Select
stLinkCriteria = "[tCorrespondence].[ID]=" & Me.ID1
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Subject1_DblClick:
Exit Sub
Err_Subject1_DblClick:
MsgBox Err.Description
Resume Exit_Subject1_DblClick
End Sub
I got a code to open 1 of 2 possible forms on the double click event of a
text field.
I dont see where the problem lies. When i try to double click the field it
simply says "MS Access cannot find the field "|" referred to in your
expression". I dont have any field called "|". [ID] & [Type] fields are
numbers. Where it went wrong?
Can anybody help please? I paste the code below.
Thank you.
Lana
Private Sub Subject1_DblClick(Cancel As Integer)
On Error GoTo Err_Subject1_DblClick
Dim stDocName As String
Dim stLinkCriteria As String
Select Case True
Case (Nz([tCorrespondence].[Type], 0) = 1)
stDocName = "CorrIncoming"
Case (Nz([tCorrespondence].[Type], 0) = 2)
stDocName = "CorrOutgoing"
Case Else
End Select
stLinkCriteria = "[tCorrespondence].[ID]=" & Me.ID1
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Subject1_DblClick:
Exit Sub
Err_Subject1_DblClick:
MsgBox Err.Description
Resume Exit_Subject1_DblClick
End Sub