User Form Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a section of my program that will display a different user form
depending on what a given input was (NT1s). I know that following will work
to display the correct form but I was wondering if there was a way to use the
variable "NT1s" in a single line to show the correct form. Something like
ModConfig(NT1).Show

As always, any help is greatly appreciated!

If NT1s = 1 Then
ModConfig1.Show
End If
If NT1s = 2 Then
ModConfig2.Show
End If
If NT1s = 3 Then
ModConfig3.Show
End If
If NT1s = 4 Then
ModConfig4.Show
End If
 
Hi Tony,
Something like
ModConfig(NT1).Show

As always, any help is greatly appreciated!

If NT1s = 1 Then
ModConfig1.Show
End If
If NT1s = 2 Then
ModConfig2.Show
End If
If NT1s = 3 Then
ModConfig3.Show
End If
If NT1s = 4 Then
ModConfig4.Show
End If

Sure:

VBA.Userforms("ModConfig" & NT1s).Show

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

User Form 8
Access Sub form opens before the main form in MS Access 0
Looping code 3
How to activate a User Form 1
User Form Problem 2
User form Text Box & Combo Box. 5
user form image 8
User Form Appears Blank 2

Back
Top