X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> String To Enumeration, Access 2016    
post Aug 9 2018, 03:25 PM

Posts: 899
Joined: 7-June 02
From: Maryland

I have a table that supplies values to a treeview control on a form. One of the fields within the table stores an enumeration (pfnImage for example) as the value. When I pull the value from the table it is a string. How do I convert it to the enumeration? The work around was to store the physical value of the enumeration in the field which works fine. Just wanted to know if there was a way to do it otherwise.

Public Enum numPopupForm

pfnImage = 1
pfnLocation = 2
pfnMain = 3
pfnPeople = 4
pfnSplash = 5

End Enum
Go to the top of the page
post Aug 9 2018, 04:12 PM

UtterAccess VIP
Posts: 8,652
Joined: 25-October 10
From: Gulf South USA

Hi: Not sure I understand what you are going to do with the value you set for the variable, but the table seems a good way to store the value permanently. Or you can set the value in a TempVar and use it anywhere in the db until the db closes...

TempVars!pfnImage = 1

Then call it as TempVars!pfnImage when you need it.

Or perhaps I do not understand the requirement ...


"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page

Custom Search
RSSSearch   Top   Lo-Fi    18th August 2018 - 02:42 PM