This code works fine in Access and VBA, however, in an Access Project connected to SQL 7 it errors on the DCount line. I'm stumped and need help or advice why this errors.
The code is designed to select a specific record from a list box and show it to the user.
Any help is appreciated.
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "901"
stLinkCriteria = "[Case NO]=" & "'" & Me![List21] & "'"
If DCount("[Case NO]", "[CHP1]", "[Case NO]=Forms!_[PrintForm]![List21]"
> 0 Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
MsgBox "Face Page of Your Report is Open"
The code is designed to select a specific record from a list box and show it to the user.
Any help is appreciated.
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "901"
stLinkCriteria = "[Case NO]=" & "'" & Me![List21] & "'"
If DCount("[Case NO]", "[CHP1]", "[Case NO]=Forms!_[PrintForm]![List21]"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
MsgBox "Face Page of Your Report is Open"