Hi, I am having an issue with not finding the criteria in the domain. I cannot get the MEF# to populate and find it in Sheet1. I know there is a difference in code from a numeric value to a text value. MEF# is a text value. I tried changing the code to use the text value correctly but nothing has worked out. Any help would be appreciated. Thanks, Nick The problem begins after the comment Check if MEF# is valid.
Code:
Private Sub Command39_Click()
Dim MEFVar, MEFVarX
' Check that the MEF is 6 digits
MEFVar = InputBox("Enter a MEF Number to start a new Chargeback:", "Open New Chargeback")
If Len(MEFVar) <> 6 Then
MsgBox MEFVar & " is not a valid MEF Number."
End
End If
'Check that MEF is valid
MEFVarX = DLookup("MEF#", "Sheet1", "MEF# = " & MEFVar)
If IsNull(MEFVarX) = True Then
MEFVarX = MsgBox(MEFVar & " is not found on the list of MEF numbers. " & vbNewLine & vbNewLine & "Do you want to write a Chargeback for this MEF " & MEFVar & "?", 4)
If MEFVarX <> 6 Then
End
End If
End If