Hello,
I want to open a subform with this code:
[Nyilvantartasi szam] and [Cim] are text type, [Datum] is date type, so in the 4th case when
stLinkCriteria = "[Datum]='" & Me![Datum] & " '"
I get the error: "Data type mismatch in criteria expression"
What is the right syntax for date type stLinkCriteria ?
Thanks for your help.
I want to open a subform with this code:
Code:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "validalas"
If IsNull([Nyilvantartasi szam]) And Not IsNull([Cim]) Then
stLinkCriteria = "[Cim]=" & "'" & Me![Cim] & "'"
End If
If IsNull([Cim]) And Not IsNull([Nyilvantartasi szam]) Then
stLinkCriteria = "[Nyilvantartasi szam]=" & "'" & Me![Nyilvantartasi szam] & "'"
End If
If Not IsNull([Cim]) And Not IsNull([Nyilvantartasi szam]) Then
stLinkCriteria = "[Nyilvantartasi szam]=" & "'" & Me![Nyilvantartasi szam] & "'"
End If
If IsNull([Cim]) And IsNull([Nyilvantartasi szam]) Then
stLinkCriteria = "[Datum]='" & Me![Datum] & " '"
End If
DoCmd.OpenForm stDocName, , , stLinkCriteria
stLinkCriteria = "[Datum]='" & Me![Datum] & " '"
I get the error: "Data type mismatch in criteria expression"
What is the right syntax for date type stLinkCriteria ?
Thanks for your help.