VRTech
asked on
ComboBox Selection on Form1 to fill dataset on Form2
How do I get the results from a combo box on form1 to be used in a query that populates the dataset on form2? VB2005.
You'll just have to remove some of these strings and adapt it to work with the combobox, but thats how you can pass values between forms.
ASKER
OK, so I'm creating a function on Form1 that passes values to a function residing on Form2. The values being passed are derived from my combo box (cboLastName.displayMember ) and associated txt field (txtManagerID). The function in Form2 then passes the values received to a SQLCommand (Select * from tblManagers where ManagerID = @ManagerID) to populate a dataset. Is that about right?
Looks good, I'm not much for SQL, however that is the method I use to pass data from my login form to another form in my application. So it should work for your purpose aswell.
ASKER
what are you validating the users password against? isn't it a value in a table in your database? What are you using besides SQL?
Well its validating with a php script that does use sql using a http request.
So vb.net is not connecting to the sql directly.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm going to code it. I'll let you know how it comes out. Thanks.
any luck?
ASKER
Still working on it.
I will leave the following recommendation for this question in the Cleanup topic area:
Accept: JPERKS1985 {http:#18098283}
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
TheLearnedOne
EE Cleanup Volunteer
Accept: JPERKS1985 {http:#18098283}
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
TheLearnedOne
EE Cleanup Volunteer
F1.PassLoginData(EstrUser,
Application.Run(F1)
Put this function in Form2
Public Function PassLoginData(ByVal Usr As String, ByVal PW As String, ByVal Session As String)
eUsr = Usr
ePW = PW
eSession = Session
End Function
Define these in declarations on form2
Dim eUsr As String
Dim ePW As String
Dim eSession As String