allyson787
Programmer
I am going through all the name fields in my table and adding them to a listbox. When a name is doubleclicked on the listbox I want my textboxes to show the other fields for that persons record from a table with the same EmployeeNumber (datatype as string).
There is a runtime error rowset does not support scrolling backwards with my find method. How do I get this to work? Here is my code.
Private Sub lstEmployee_DblClick()
SQL = "SELECT employee1.* from employee1;"
Set rsEmp = gCnn.Execute(SQL)
rsEmp.MoveFirst
strEmpLastName = lstEmployee.Text
rsEmp.Find ("[EmpNum] = '" & strRec & "'")
Do Until rsEmp.EOF
strEmpNum = rsEmp.Fields("EmpNum") & ("")
strFirstName = rsEmp.Fields("EmpFirstNme") & ("")
strAddress = rsEmp.Fields("EmpAddress") & ("")
strCity = rsEmp.Fields("EmpCity") & ("")
strState = rsEmp.Fields("EmpState") & ("")
txtFName2.Text = strFirstName
txtLName2.Text = strEmpLastName
txtCity.Text = strCityloop
txtState.Text = strState
txtAddress.Text = strAddress
txtZipCode.Text = strZipCode
Loop
rsEmp.Close
End Sub
There is a runtime error rowset does not support scrolling backwards with my find method. How do I get this to work? Here is my code.
Private Sub lstEmployee_DblClick()
SQL = "SELECT employee1.* from employee1;"
Set rsEmp = gCnn.Execute(SQL)
rsEmp.MoveFirst
strEmpLastName = lstEmployee.Text
rsEmp.Find ("[EmpNum] = '" & strRec & "'")
Do Until rsEmp.EOF
strEmpNum = rsEmp.Fields("EmpNum") & ("")
strFirstName = rsEmp.Fields("EmpFirstNme") & ("")
strAddress = rsEmp.Fields("EmpAddress") & ("")
strCity = rsEmp.Fields("EmpCity") & ("")
strState = rsEmp.Fields("EmpState") & ("")
txtFName2.Text = strFirstName
txtLName2.Text = strEmpLastName
txtCity.Text = strCityloop
txtState.Text = strState
txtAddress.Text = strAddress
txtZipCode.Text = strZipCode
Loop
rsEmp.Close
End Sub