Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate a Drop Down Box from DB

Status
Not open for further replies.

Fletch12

IS-IT--Management
Aug 13, 2002
140
US
I have a table in our database with employee information. I was wondering how to populate a drop-down box on the front-end (user side) with just that employee's info, and not all the information from that field.

ex.

Emp LeaveOn

1 Brother
1 Brother
1 Sister
1 Mother

2 Father
2 Mother
2 Father
2 Father


Results:

An employee number is keyed in, and then a drop-down box would be filled with the appropriate info. Such as for Emp 1, a drop-down box would contain "Brother, Sister, Mother", but Emp 2 would contain "Father, Mother." Instead of them both having a drop-down box with all the choices. And then the user could search based on that criteria.
 
If I am understanding you correctly, you just need to use a SQL statement to select the records pertaining to that particular employee:

Dim SQL

SQL = "SELECT DISTINCT LeaveOn FROM tblTable WHERE EmpID = " & intEmpID

intEmpID would hold the ID value that was keyed in by the user (page would need to refresh if the textbox was on the same page.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top