cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alexx1
Helper II
Helper II

create a variable name with another variable

Hello!

 

I have a problem here:

 

I want to create a variable name with a concatenate function but this doesn't work:

 

Set("varNon"&varNum;"")

 

You have to know that varNum is a variable already created (no problem with that).

The variable name should look like this: varNon3 or varNon4 ... according to the varNum variable value.

 

I'll really appreciate some help!

 

Thanks!

2 REPLIES 2
eka24
Super User
Super User

Try:

Set(var1,"abc");Set(var2,"sse");Set(Var3,var1&var2)

set.JPG

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Thanks for the answer!

 

let me expose my problem maybe you will be able to help me out:

 

I have a form like this:

For each question of the form, In the function OnChange you can see that I set my 2 variables: VarNonQuestionNumber (and I but this variable in the Default property) and VarNum for the number of the question.

Capture.PNG

 

And when people clic "Non" in the drop down; the function OnChange gets me in another page:

Alexx1_0-1611223513974.png

 

When people clic on the "X" Icon to quit this page, I want the dropdown to take the Empty value (""). Thats why I have to set a different variable name each time..

 

That's why I am creating a new variable for each question; so that if they clic the "X" to exit the page, it only updates the value of the last question..

 

I hope I was clear, and if you have any idea to do it an other way I would appreciate!

 

Thanks for your time

 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,585)