954,582 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Link from one form to another

This seems so simple, so why can't I figure out how to do it?

All I want to do is have two forms, and if you click a button on Form1, Form2 will load (replaying Form1). In a Windows App.

How ????

Thanks for any help.

k89mmk
Newbie Poster
2 posts since Sep 2003
Reputation Points: 10
Solved Threads: 0
 

well if im understanding what you want all you would have to do is is use the formname.show to show the other form and a me.hide to hide the current forums. so kind of like this

Private Sub cmdbutton1()
   form2.show
   me.hide
End Sub
big_k105
PFO Founder
Team Colleague
357 posts since May 2003
Reputation Points: 36
Solved Threads: 2
 

how to link forms sql with vb?????

Tanuja
Newbie Poster
3 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
 

What do u mean by forms sql ?

Please clarify for further detail explanation.

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

i tried the code above and its working...
i love it!!!
i lean something from this site... hope i could learn more...
im sure... pretty sure... xD

WhitePunk
Newbie Poster
11 posts since Oct 2007
Reputation Points: 10
Solved Threads: 0
 

:-/ :confused: All I want to do is have two forms, and if you click a button on Form1, Form2 will loaded
Any help plz

mjhd
Newbie Poster
1 post since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

I'm making a system and need to link one form to another. meaning- say --> I click login---another form comes up allowing the user to login......how to do dat'?

KrissyG88
Newbie Poster
1 post since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

You need to read Post #2.

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 
'If Form1 is currently showing on your screen, click the command1 button to load your other form (frmLogin)

frmLogin.Show 1 '1 is vbModal, in other words, the top most form that will have the focus above any other forms.

Unload Me 'Where Me = your first form (Form1)
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

AndreRet,

The code you provided will end the application (if there are only two forms) and I'll tell you why...

When you go Form2.Show vbModal from Form1, code execution stops in Form1 and begins in Form2, because of this, Form1 is now not accessible because Form2 has been shown modal. The only way to have the next line of code execute in form1 is unloading form2 and once you do, Form1 unloads.

vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
 

vb5prgrmr,

You are so right. You know the saying "No Brain No Gain". Exactly what happened here. Did not think it through now did I?

Should have used something like "Me.Hide" etc.

Thanks for pointing this out...

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

well if im understanding what you want all you would have to do is is use the formname.show to show the other form and a me.hide to hide the current forums. so kind of like this

Private Sub cmdbutton1()
   form2.show
   me.hide
End Sub


You are actually the most amazing person ever THANKYOU!!!!!!!!! you totally just saved my AS-coursework project :)

sophiew41
Newbie Poster
1 post since Dec 2009
Reputation Points: 10
Solved Threads: 0
 

thank you for the information...i know now how to links form..i got it.

pets futu
Newbie Poster
1 post since Dec 2010
Reputation Points: 10
Solved Threads: 0
 

Poster #3 : Please don't bump threads, start your own.

Please mark thread as solved

abelingaw
Posting Whiz in Training
205 posts since Jun 2008
Reputation Points: 66
Solved Threads: 26
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You