Hi guys
I get a Data type mismatch in criteria expression error in my Dlookup expression.
When I add a Toggle Breakpoint and step over each line all the values are there and correct. The Dlookup picks up the Motherid but not the Litternumber.
I just can't see what I'm doing wrong.
I get a Data type mismatch in criteria expression error in my Dlookup expression.
When I add a Toggle Breakpoint and step over each line all the values are there and correct. The Dlookup picks up the Motherid but not the Litternumber.
I just can't see what I'm doing wrong.
Code:
Dim Motherid As Long
Motherid = Me.DogID
Dim Mother As String
Mother = Me.CallName
Dim Litternumber As Long
Litternumber = InputBox("Enter Litter number")
Dim ReproID As Long
ReproID = DLookup("reproductionid", "[tblreproduction]", "[motherid]='" & [Motherid] & "' and [mlittercount] = '" & Litternumber & "'")