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.

Re: Link from one form to another 80 80

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
Re: Link from one form to another 80 80

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

Re: Link from one form to another 80 80

What do u mean by forms sql ?

Please clarify for further detail explanation.

Re: Link from one form to another 80 80

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

Re: Link from one form to another 80 80

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

Re: Link from one form to another 80 80

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

Re: Link from one form to another 80 80

You need to read Post #2.

Re: Link from one form to another 80 80
'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)
Re: Link from one form to another 80 80

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.

Re: Link from one form to another 80 80

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

commented: "No Brain No Gain" -> :) +10
Re: Link from one form to another 80 80

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 :)

Re: Link from one form to another 80 80

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

Re: Link from one form to another 80 80

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

Please mark thread as solved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.