473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to refere a form by name if the name is stored into a variable ?

759 512MB
Hi !
I have a variable (strFormName as String) where I have stored the name of a form.
Is it possible to refer that form by using the stored name ?
Something like this:

Form(strFormName).Visible = True

Thank you !

Note please that I know how to loop to every form in Forms collection until I find the desired form.
This is not what I am looking for.
Jul 9 '12 #1

✓ answered by MikeTheBike

Hi

Yes is the answer, which you very nearly have already. The Forms collection is access by
Forms(strFormName).Visible = True

ie you just need as s in Forms.

It is necessary for the form to be Open/Loaded for this to work.

HTH

3 1898
MikeTheBike
639 Expert 512MB
Hi

Yes is the answer, which you very nearly have already. The Forms collection is access by
Forms(strFormName).Visible = True

ie you just need as s in Forms.

It is necessary for the form to be Open/Loaded for this to work.

HTH
Jul 9 '12 #2
TheSmileyCoder
2,322 Expert Mod 2GB
Just to add to a allready good answer, you can check whether the form is open by checking the property:
Expand|Select|Wrap|Line Numbers
  1. currentproject.AllForms(strFormName).IsLoaded
Jul 9 '12 #3
Mihail
759 512MB
Thank you, Mike and thank you Smiley !
I don't know (until now) the .IsLoaded feature. Very good to know this. Thank you again !
Jul 9 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Randell D. | last post by:
I have a script (below) that can be passed an array and it will dump the contents of the array in to an html table - I use it during development so its nothing sexy. It handles multidimsional...
5
by: Matt Clepper | last post by:
Any way to do this? I need to call functions based on a variable. Do I actually have to make a case statement and call each funciton explicitly, or is there any way to call a function where the...
2
by: Josh Strickland | last post by:
I am attempting to create an Access database which uses forms to enter data. The issue I am having is returning the query results from the Stored Procedure back in to the Access Form. ...
11
by: Ahmet AKGUN | last post by:
Hi; is it possible to open one form in .net platform that we have its name in string ? I have string sFormName = "frmCustomer"; and I must automatically open Customer form. or is it...
8
by: Azat | last post by:
Hi, I am wondering if there is a way in C# to get the name of a variable. Let's say: int MyName=3; How can I get a string with the Value "MyName"? Any ideas on that? Thanks
4
by: Michael R | last post by:
Hi All. Is it possible to concentrate dim frm as Form set frm = Forms! & strVar or dim frm as Form strVar = "Forms!frmFormName" set frm = strVar
2
reginaldmerritt
by: reginaldmerritt | last post by:
Is there a way of having a variable name containing a variable. I have some code relating to a section of fields on a form, i then have an identicle code relating to another (very simular) section of...
6
by: Sagari | last post by:
Greetings, Can someone suggest an efficient way of calling method whose name is passed in a variable? Given something like: class X: #... def a(self):
9
by: Erwin Moller | last post by:
Hi all, Is it possible (PHP5.2) to find the name of a variable used in the caller of a function from within the function itself? Or to be more clear: ...php code.. $result = foo($abc);...
1
by: mathew1 | last post by:
How can I open a file whose file name is stored in a variable Thank you in advance
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.