UtterAccess.com
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    
 
   
jokeme71
post Aug 9 2018, 03:25 PM
Post#1



Posts: 918
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
 
RJD
post Aug 9 2018, 04:12 PM
Post#2


UtterAccess VIP
Posts: 8,941
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 ...

HTH
Joe
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    20th October 2018 - 06:35 AM