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

how to move amongst differnet forms..

Status
Not open for further replies.

santonimc

Programmer
Aug 1, 2005
2
LC
I m facing this problem..i m finding myself unable to move amongst different vb forms..help me.?

this was the error i got :

C:\Documents and Settings\Santosh Singh Rawat\My Documents\Visual Studio Projects\PayRoll\PayRoll_Main.vb(163): Reference to a non-shared member requires an object reference.
 
You need to use the new keyword to create an instance of your object.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Below is how I moved to another form. Spoilage is the name of the other form.
I did not have to use the NEW.


Code:
If excessiveCheckBox.Checked Then
            reportDialogResult = MessageBox.Show("Would you like to fill out an Excessive DT/MR Report", "DT/MR Request", _
            MessageBoxButtons.YesNo, MessageBoxIcon.Question)
            If reportDialogResult = DialogResult.Yes Then
                'Call Spoilage form
                Dim mySpoilage As New Spoilage
                mySpoilage.Show()
            Else
                Exit Sub
            End If
        End If
 
thanx a lot chiph and richself...

i corrected my mistake..and able to switch amongst different forms..
but got an error ..
i want to use crystal reports..but when i used the action method with that crystal report. i got error..

help me..

 
To help us help you, please post some snippets of code where you want to show the report and which error you get, preferrably on what line.

Regards, Ruffnekk
---
Is it my imagination or do buffalo wings taste just like chicken?
 
I did not have to use the NEW.
Rich...can I point you to these 2 lines of code...
Code:
Dim mySpoilage As [b]New[/b] Spoilage
mySpoilage.Show()
A form is an object, you have to create an instance of a form before you can show it.


Sweep
...if it works dont f*** with it
curse.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top