Coding help with data input

purceld2

Registered User.
Local time
Today, 19:29
Joined
Dec 4, 2008
Messages
79
The code below expects the user to input a valid project code which is in the PM000XXX format. What I am trying to do is allow the user to either enter the full project code or the last three digits as the first five digits are the same. I know you would need to test what has been input and if it is the last three digits concatenate it with the first 5 before passing to query.

Can someone point in the right direction?

Thank you in advance

Code:
MyVariable = InputBox("Please Enter The Clarity Project Number.", "Project Input")
  If IsNull(MyVariable) = True Or MyVariable = "" Then
    MsgBox "Please Enter A Valid Clarity Project Ref (PM000XXX).", vbCritical
 
If you want to use an input box, why not just always ask for the last three digits?


If it were me, I would use a form with a combo box to pick a valid entry.
 

Users who are viewing this thread

Back
Top Bottom