Home All Groups Group Topic Archive Search About

Passing parameters to 2nd form issue

Author
29 Jun 2005 8:01 AM
marcmc
Error = (Too many arguments to Public Sub New()'

I have done this before but this project is giving me trouble.
At the declaration point of my Login screen I have

Windows Form Designer Code...
Dim UName as String

I then query the database with a datareader to set UName from the login name
in the screens text box.

UName = dtr.GetString(0)
....

After this is validated I try to Load and Send the UName param to screen
2(MIS)...

Dim frmMIS as New MIS(UName)
frmMIS.Show()

I then use Messagebox.Show(UName) on the MIS(form2) Load event.

Please help.

Cheers
marc

Author
29 Jun 2005 8:55 AM
Crouchie1998
See this thread:

http://www.gotdotnet.com/Community/MessageBoard/Thread.aspx?id=326413&Page=1#326460

I hope this helps

Crouchie1998
BA (HONS) MCP MCSE
Author
29 Jun 2005 9:47 AM
Armin Zingler
Show quote Hide quote
"marcmc" <mar***@discussions.microsoft.com> schrieb
> Error = (Too many arguments to Public Sub New()'
>
> I have done this before but this project is giving me trouble.
> At the declaration point of my Login screen I have
>
> Windows Form Designer Code...
> Dim UName as String
>
> I then query the database with a datareader to set UName from the
> login name in the screens text box.
>
> UName = dtr.GetString(0)
> ...
>
> After this is validated I try to Load and Send the UName param to
> screen 2(MIS)...
>
> Dim frmMIS as New MIS(UName)
> frmMIS.Show()
>
> I then use Messagebox.Show(UName) on the MIS(form2) Load event.
>
> Please help.


If you don't have a constructor with 1 argument, you must add one.

Armin
Author
29 Jun 2005 12:22 PM
Supra
Dim frmMIS as  MIS(UName)
regards

Armin Zingler wrote:

Show quoteHide quote
> "marcmc" <mar***@discussions.microsoft.com> schrieb
>
>> Error = (Too many arguments to Public Sub New()'
>>
>> I have done this before but this project is giving me trouble.
>> At the declaration point of my Login screen I have
>>
>> Windows Form Designer Code...
>> Dim UName as String
>>
>> I then query the database with a datareader to set UName from the
>> login name in the screens text box.
>>
>> UName = dtr.GetString(0)
>> ...
>>
>> After this is validated I try to Load and Send the UName param to
>> screen 2(MIS)...
>>
>> Dim frmMIS as New MIS(UName)
>> frmMIS.Show()
>>
>> I then use Messagebox.Show(UName) on the MIS(form2) Load event.
>>
>> Please help.
>
>
>
> If you don't have a constructor with 1 argument, you must add one.
>
> Armin
Author
29 Jun 2005 12:26 PM
Armin Zingler
"Supra" <supra@domain.invalid> schrieb
> Dim frmMIS as  MIS(UName)
> regards

Pardon?

Armin

Show quoteHide quote
>
> Armin Zingler wrote:
>
> > "marcmc" <mar***@discussions.microsoft.com> schrieb
> >
> > > Error = (Too many arguments to Public Sub New()'
> > >
> > > I have done this before but this project is giving me trouble.
> > > At the declaration point of my Login screen I have
> > >
> > > Windows Form Designer Code...
> > > Dim UName as String
> > >
> > > I then query the database with a datareader to set UName from
> > > the login name in the screens text box.
> > >
> > > UName = dtr.GetString(0)
> > > ...
> > >
> > > After this is validated I try to Load and Send the UName param
> > > to screen 2(MIS)...
> > >
> > > Dim frmMIS as New MIS(UName)
> > > frmMIS.Show()
> > >
> > > I then use Messagebox.Show(UName) on the MIS(form2) Load event.
> > >
> > > Please help.
> >
> >
> >
> > If you don't have a constructor with 1 argument, you must add one.
> >
> > Armin