Unanswered: Using a Combo Box to Search for Employee records
I created a Database table in MS Access 2000.I also have Text Boxes and a Combo box on a Vb 6 Form. I intend to store the names of Employees in the Combo box.
I connected the Text boxes on the Form to the Database through ADO control which I placed on the Form.
I want the user to be using the Combo box to search Employee records. When the user selects an employee name from the Combo box, the records of the employee whose name is selected from the Combo box should be displayed automatically in the Text boxes placed on the Vb6 Form.
Since you wish to only load the single employee record, open a recordset using SELECT * FROM YOURTABLENAME WHERE EMPLOYEENAMEFIELD = ' & cmbEmployees.Text & "'"
When the recordset opens, assuming that you have an array of textboxes - one for each field in the table, named txtEmployee
Dim N as Integer
For N = 0 to rs.Fields.Count-1
Me.txtEmployee(N).Text = "" & rs.Fields(N).Value
Note that the employee textbox control array must begin with zero, and each control array element (index) must match the corresponding field position in the table
Post your code (after reviewing the tutorial and trying the above suggestions,) along with any problems that you're experiencing, and we'll be glad to help out.
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert