send a value from a form to another form or just access that value somehow
Posted on 2006-05-02
I am trying to get a value from a form to use in a different form. The one form has a textbox that the user enters their employee ID into. Then that form uses that ID to decide what form to go to next. So it then chooses the clock in and out form which needs the employee ID that the user entered on the other form. I've been trying to set variables to public and also I tried making get and set functions and using them to retrieve the value.
here is some code...
Public rEmpID As String (this is at the top of the login form)
setEmp(dr(0)) (this is in a button click procedure retrieving the employeeID from an executereader
but I maybe could also get the value from the textbox)
Public Function setEmp(ByVal emp As Integer)
rEmpID = emp (my set and get functions located in the login form)
Public Function returnEmp()
Public loginForm As New LogForm (this is at the top of the clock in and out form)
employeeID = loginForm.returnEmp() (this is in a button click procedure in the clock in and out form)
So I'm not sure how to make this work, any ideas would be great!