EternalMyrtle
I'm still alive
- Local time
- Today, 03:45
- Joined
- May 10, 2013
- Messages
- 533
Hello I am trying to use this code to filter a continuous subform based on two criteria but getting a data type mismatch error.
It works fine if I filter by just one or another. Perhaps it is not possible
Or, does someone know a way?
It works fine if I filter by just one or another. Perhaps it is not possible

Or, does someone know a way?
Code:
Dim intSpouseEntityID As Integer
intSpouseEntityID = Nz(DLookup("[EntityID]", "qryEntitiesLocations", "[ContactIDNumber] =" & Me.Spouse), 0)
If intSpouseEntityID > 0 And Not IsNull(Me.subformContactsHomeAddress.Form.EntityID) Then
MsgBox ("There are two spouse addresses please delete one and try again")
DoCmd.Save
DoCmd.OpenForm "frmContactAddresses", , , "EntityID=" & Me.txtEntityID Or "EntityID =" & intSpouseEntityID
End If