Cannot use custom enumeration as a function parameter

I cannot get my custom enumeration values to appear as a drop-down list when trying to pass one of them to another function.  The enumeration and function are in a standard module, and the function call is in a form control.

Here is the enum:
Public Enum FileTypes
    fdtAll = 1
    fdtExcel = 2
    fdtText = 3
End Enum

Open in new window


Here is my function call:
strSelectedFileFullPath = fncFD_GetFileName(strInitialFolder, fdtExcel, fdtAll, , "Select the EDI transaction folder")

Open in new window


And here is the function:
Public Function fncFD_GetFileName(parmInitialFileName As String, _
                parmFilter1 As Long, _
                Optional parmFilter2 As Long, _
                Optional parmFilter3 As Long, _
                Optional parmBoxTitle As String, _
                Optional parmView As MsoFileDialogView = msoFileDialogViewDetails) As String

Open in new window


I also tried it this way:
Public Function fncFD_GetFileName(parmInitialFileName As String, _
                parmFilter1 As Long, _
                Optional parmFilter2 As FileTypes, _
                Optional parmFilter3 As FileTypes, _
                Optional parmBoxTitle As FileTypes, _
                Optional parmView As MsoFileDialogView = msoFileDialogViewDetails) As String

Open in new window

LVL 2
Alan VargaAccess DeveloperAsked:
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.

Alan VargaAccess DeveloperAuthor Commented:
I found my own answer by experimenting.  The parameter in the function call has to be FileTypes.ftdExcel.  Using the enum name followed by a dot displays the desired value selections.  This question can be closed or cancelled.
0

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
Alan VargaAccess DeveloperAuthor Commented:
Please cancel this question, unless leaving it for reference.
0
Anders Ebro (Microsoft MVP)Microsoft DeveloperCommented:
No, you don't need the FileTypes first. Your second attempt was close, but I believe you messed up the data types of parmFilter1 and parmBoxTitle (corrected below):
Public Function fncFD_GetFileName(parmInitialFileName As String, _
                parmFilter1 As FileTypes, _
                Optional parmFilter2 As FileTypes, _
                Optional parmFilter3 As FileTypes, _
                Optional parmBoxTitle As String, _
                Optional parmView As MsoFileDialogView = msoFileDialogViewDetails) As String

Open in new window

1
Alan VargaAccess DeveloperAuthor Commented:
Thanks Anders, you're right.  I actually did correct the code after I posted here, but didn't retest after making that change.  I just retested, and the class name is not needed.  I appreciate your help!

Alan
0
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.