1.11M Members

Link from one form to another

 
0
 

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.

 
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
 
0
 

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

 
0
 

What do u mean by forms sql ?

Please clarify for further detail explanation.

 
0
 

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

 
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

 
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'?

 
0
 

You need to read Post #2.

 
0
 
'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)
 
0
 

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.

 
2
 

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...

 
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

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

 
0
 

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

 
0
 

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

Please mark thread as solved

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article