|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Passing parameters to 2nd form issueI 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 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
Show quote
Hide quote
"marcmc" <mar***@discussions.microsoft.com> schrieb If you don't have a constructor with 1 argument, you must add one.> 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. Armin 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 "Supra" <supra@domain.invalid> schrieb Pardon?> Dim frmMIS as MIS(UName) > regards 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 |
|||||||||||||||||||||||