P
Penstar
I have the following code, but get type mismatch error... OrderID & PackID
are Integars and ProductID is a string. Each one works on their own, but get
the mismatch error when I try to put more then one in as the criteria.
Dim strType As String, strWhere As String, strType1 As String, strWhere1
As String, strType2 As String, strWhere2 As String
strType = Me.OrderID
strWhere = "[OrderID]=" & strType
strType1 = Me.ProductID
strWhere1 = "[ProductID]=""" & strType1 & """"
strType2 = Me.PackID
strWhere2 = "[PackID]=" & strType2
If IsNull(DLookup("OrderID", "dbrderDetails", strType And strType1
And strType2)) Then
MsgBox ("test")
Else
MsgBox "This Product and Packaging are already entered."
Cancel = True
Me.Undo
End If
are Integars and ProductID is a string. Each one works on their own, but get
the mismatch error when I try to put more then one in as the criteria.
Dim strType As String, strWhere As String, strType1 As String, strWhere1
As String, strType2 As String, strWhere2 As String
strType = Me.OrderID
strWhere = "[OrderID]=" & strType
strType1 = Me.ProductID
strWhere1 = "[ProductID]=""" & strType1 & """"
strType2 = Me.PackID
strWhere2 = "[PackID]=" & strType2
If IsNull(DLookup("OrderID", "dbrderDetails", strType And strType1
And strType2)) Then
MsgBox ("test")
Else
MsgBox "This Product and Packaging are already entered."
Cancel = True
Me.Undo
End If