Hi!
Does any 1 know how I can reference the startup form
in a project via code...
(If you go into your project's properties, click on the
General tab, and StartUp Object...)
Thanks in advance..
Printable View
Hi!
Does any 1 know how I can reference the startup form
in a project via code...
(If you go into your project's properties, click on the
General tab, and StartUp Object...)
Thanks in advance..
im not sure that this will work, but a simple way would be to set it as a variable first. Im not sure if this is what you are asking, but you could just define a global variable frmStartUpForm as Form.
and just put frmStartUpForm = form1.(form?)
i dont knoe if you need the form at the ened but hey you might. ive never had the need to do this but that will probably work
and then when you want to activate it just do frmStartUpForm.show. or load frmStartUpForm i think may work also, but you may have to tweak the code some to get it to work.
I am not supposed to know what it is
I am supposed to look into that area and find out what is there and use it...
Thanks in advance
I'm assuming that at the point where the program needs to know this, the project file will exist on disk. If it's just the exe, you should have known the startup object when you made the exe.
Open the *.vbp file for input, and read in 1 line at a time. Look for:
Startup="Sub Main"
and take everything after the =, then strip the quotes.
jmc.....Thanks...
Now, If I can take that string and turn into an object
so that I can do, say, (mine being a form)
frmOne.something
I'd be all set
You can, but only if the form is loaded:
Code:Dim strForm As String
Dim frm As Form
strForm = "frmMain"
For Each frm In Forms
If frm.Name = strForm Then Exit For
Next
Debug.Print frm.Caption
Set frm = Nothing
Very gut.... my friend
Thanks