I am new to writing vba code and am currently trying to open a form with a couple of criteria that are typed into several boxes. When all given criteria are larger than 0, it should search for those items. I chose deliberately to put it in a openfrm function to try it out.
If IsNull(Naamtabel) = False And IsNull(plaatstabel) = False And IsNull(postcodetabel) = False And IsNull(telefoontabel) = False Then
DoCmd.OpenForm "frmContacten", , , "Naam like '*" + Naamtabel.Value + "*'" _
And "Plaats like '*" + plaatstabel.Value + "*'" _
And "Postcode like '*" + postcodetabel.Value + "*'" _
And "Telefoonnummer like '*" + telefoontabel.Value + "*'"
Else
MsgBox "No criteria to meet"
End If
Access is giving an Runtime error 13 type mismatch. But i know there are items that should appear. When I run the debug, the DoCmd part is enlightened
I hope someone can help me to figure out what's wrong with this.
Thanks in advance!
If IsNull(Naamtabel) = False And IsNull(plaatstabel) = False And IsNull(postcodetabel) = False And IsNull(telefoontabel) = False Then
DoCmd.OpenForm "frmContacten", , , "Naam like '*" + Naamtabel.Value + "*'" _
And "Plaats like '*" + plaatstabel.Value + "*'" _
And "Postcode like '*" + postcodetabel.Value + "*'" _
And "Telefoonnummer like '*" + telefoontabel.Value + "*'"
Else
MsgBox "No criteria to meet"
End If
Access is giving an Runtime error 13 type mismatch. But i know there are items that should appear. When I run the debug, the DoCmd part is enlightened
I hope someone can help me to figure out what's wrong with this.
Thanks in advance!