I am making a duplicate entry notification. But the values will not equal for the notification msgbox to kick in. I have made this work before with another line of code by dim the value as double. But this will not work at all. Please take a look and tell me what you think.
Code:
Dim Line1, Line2, Line3, Line4, Line5 As Double
'LineItem1
If cb_DFB_OI_QTY1 = 1 And txt_DFB_OI_Price1 = "" Then
Line1 = 0
ElseIf cb_DFB_OI_QTY1 = 1 And txt_DFB_OI_Price1 > 0 Then
Line1 = Me.txt_DFB_OI_Price1.Value
Else
Line1 = Me.cb_DFB_OI_QTY1.Value * Me.txt_DFB_OI_Price1.Value
End If
'Checks for possible duplicate receipt entry
If Cells(1, 23) = "LIVE" And Cells(2, 1) <> "" Then
Dim Row As Integer
Row = 2
'For testing purposes
If Cells(Row, 14) = Line1 Then
MsgBox "True" & " " & Cells(Row, 14) & " " & Line1
Else
MsgBox "False" & " " & Cells(Row, 14) & " " & Line1
End If
Do Until Row = Application.WorksheetFunction.Max(Range("A:A")) + 1
If Cells(Row, 5) = Me.txt_DFB_OI_Date And (Cells(Row, 8) = Me.cb_DFB_OI_Acct1) And (Cells(Row, 14) = Line1) Then
Response = MsgBox("A receipt enerted with the same Date and Total was entered on " & Cells(Row, 3) & "." & vbCrLf & vbCrLf & _
"Would you like to cancel this current batch?", vbYesNo + vbCritical, "Duplicate Receipt Detected")
Select Case Response
Case vbYes
'Closes receipt and exit sub
Unload Me
Exit Sub
Case vbNo
'Returns to the user form and resumes
Exit Sub
End Select
End If
Row = Row + 1
Loop
End If