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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

code to open a form from a form 1

Status
Not open for further replies.

JSeidel

Technical User
Jan 10, 2003
77
US
I am a beginner and have a question -

I have a real simple UI prototype I am building but would like to execute a from from a form. For eg: user selects "OK" from form1 and this should open up form2

could someone supply me with some sample code that I could look at? I keep getting compile errors

thanks
 
What is the code you are using and what is the compile error?
The way to open(load and display all in one) is:
form2.show

Hope that helps! Post more detail if you need more help.
 
here is what I have:

if objATdoc = true then load (form at frmatdocselect)

 
i now get a message saying 'expected function or variable' where my code is

objatselect = true then load form2.show
 
Try

If objatselect = true then form2.show

I don't think you need the load in there
 
thanks - that worked perfectly.

one more question - could anyone suggest a book that I could get that would give me a good basis on how to write my code/syntax. I have the for dummies book but this was only effective for designing the UI aspect of it.

thanks again
 
Good to hear you got that working. As for a book, it depends on where you are starting. If you are looking for a good beginners book. I learned from Programming with Visual Basic 6.0 by Dianne Zak and found it very easy to follow and learn from. If you are past beginner, maybe someone else could point you to one that is more advanced. One thing I would caution though is maybe looking at learning vb.net if you are starting fresh. That is likely where things are moving to so it would be a pain to learn vb 6, then have to learn something new again.

Hope that helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top