DataBlake
Well-known Member
- Joined
- Jan 26, 2015
- Messages
- 781
- Office Version
- 2016
- Platform
- Windows
Code:
Sub findQTY()
Dim pnum As Variant
pnum = InputBox("Please Type in the part number")
If dicQTY.exists(pnum) Then
MsgBox dicQTY(pnum)
Else
MsgBox "No quantity available for this part number"
End If
End Sub
the objective is to have the user enter a part number and it will either return the quantity or display an error where the part number does not exist within the dictionary
the problem occurs when pnum is all numeric.
so something that SHOULD exist in the dictionary is
"80017" with a value of 22
It returns the "No quantity" message though.
whereas "FK3264" with a value of 7 will display the correct msgbox because its a string?
any help would be appreciated