hey ppl, i know this is aa really daft Q, but i only started using vb.net this yr and im not that gud at it!

basically i wana know how to go from one form to another using a button, wud it just be sumthin as simple as:

Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click

btnSearch = frmSearch

endSub

No, you will need to create an object variable for the form you wish to open.

Somthing like this under the button sub should work:

Dim objNewForm as New NewForm()
objNewForm.ShowDialog()

Chester

Adding to what cpopham said, make a subroutine for one of your buttons like this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

objNewForm.ShowDialog()

End Sub

Also make sure you put Dim objNewForm as New Form somewhere near the top. It should be "as New Form" and not "as New NewForm()"

That's in my version at least.

Be a part of the DaniWeb community

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