If string results equals

Dear Experts

I am using a drag and drop facility (courtesy of EE) to perform various tasks. Once a document has been dragged into the drop off area  (Me.txtDrop) a string is created 'ExtensionType' which works out the file extension (eg pdf  xls etc.). This all works fine, but I need to add in an IF statement wrapper to handle user errors that basically does this:

If 'ExtensionType' is empty then bring up a message saying "No document has been dragged across"
If 'ExtensionType' is NOT 'pdf' OR 'doc' OR 'docx'  then bring up a message saying "this file format is not supported"
else carry in with the rest of the code ...


Can anyone help?
correlateAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gustav BrockCIOCommented:
Could be:
Dim Message As String
Select Case ExtensionType
    Case ""
        Message =  "No document has been dragged across."
    Case  "pdf", "doc", "docx"
        ' OK.
    Case Else
        Message =  "This file format is not supported."
End Select

If Message <> "" Then
    MsgBox Message
    Exit Sub
End If

Open in new window

/gustav
Rey Obrero (Capricorn1)Commented:
if  ExtensionType & ""="" then
    msgbox "No document has been dragged across"
    exit sub
   elseif  'ExtensionType ="doc" or 'ExtensionType ="docx" or 'ExtensionType ="pdf" _
           or 'ExtensionType ="xls" then
   ' 'this is good

   else
         msgbox "this file format is not supported"
         exit sub
end if

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
correlateAuthor Commented:
Thanks for this, apologies for the delay in accepting
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.