Hi everybody,
I am trying to find a duplicate number on Item_No field but my code always returns NOT NULL even there was no duplicates. Actually I only have 1-30 numbers on my Item_No field. Can someone tell me what is wrong with my code below?
Dim FindItemNo As Variant
NewItemNo = Item_No + 100
FindItemNo = DLookup("[Item_No]", "dbo_PMOption_History", NewItemNo)
If IsNull(FindItemNo) Then
Item_No = NewItemNo
Else
Item_No = NewItemNo + 50
End If
Do I need to Dim NewItemNo? Any ideas will be very much appreciated.
Thanks.
I am trying to find a duplicate number on Item_No field but my code always returns NOT NULL even there was no duplicates. Actually I only have 1-30 numbers on my Item_No field. Can someone tell me what is wrong with my code below?
Dim FindItemNo As Variant
NewItemNo = Item_No + 100
FindItemNo = DLookup("[Item_No]", "dbo_PMOption_History", NewItemNo)
If IsNull(FindItemNo) Then
Item_No = NewItemNo
Else
Item_No = NewItemNo + 50
End If
Do I need to Dim NewItemNo? Any ideas will be very much appreciated.
Thanks.