Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open a specific form in VB 2005

Status
Not open for further replies.

aquinox

Programmer
Jul 2, 2007
38
AU
Hi,

wondering if anyone might be able to help me here. I'm a beginner to Visual Basic 2005 Express Edition. Initially i thought it would not be much different from VB Application for Access as i'm a bit more comfortable with it now. But because i want to move our database to SQL Server, i decided to use Visual Basic 2005.

My question is very simple but i have been struggling to find the answer.

How do i open a form specified by the user?

For example in Form "StartUp", i have a button that would load up another form called "Department". This would be easier done in VBA - docmd.openform "Department"

But how do i do this in VB 2005?
I have created a new instance of Form e.g.
dim myForm = new Form()
myForm.show()

But how do i tell VB to open the form "Department"?

Thank you in advance
 
Code:
dim myForm = new [b]FormDepartment[/b]

myForm.show()
or even simple
Code:
FormDepartment.show()

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
I read your form name as "FormDepartment" it actually "Department" so the code should be
Code:
dim myForm = new Department

myForm.show()

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top