Passing parameters to 2nd form issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
marcmc said:
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
 
Back
Top