Value in Text box as criteria for query which populates combo box

zan

Registered User.
Local time
Today, 02:21
Joined
Oct 26, 2006
Messages
13
Combo box from text box value

Simple question but I've been stuck for a looong time.

So what I want to do:

1. enter a value into a text box (Home_Tel) in a form (frmStudentClass)
2. which runs a query (qryNameTel)
3. and return the results to a combo box (Student_Name) on the same form.

The same Home_Tel may have several Student_Name results.


-I have entered
[Forms]![frmStudentClass]![Home Tel]
for the criteria in the query
- However I can't get the results to turn up on the combo box
- I have the following:

Private Sub Home_Tel_AfterUpdate()
' run query
DoCmd.OpenQuery "qryNameTel"

Me.Student_Name.Requery

End Sub



Any ideas?


Or is there an easier way to tackle the problem?


Home_Tel and Student_Name are from the same tables.
I have created a query just for Home_Tel and Student_Name



Thanks everyone!
 
Last edited:
I've actually solved the problem, in case anyone else is interested.

I set

Private Sub Home_Tel_AfterUpdate()
Me.Student_Name.Requery
End Sub

and

Row source for my combo box Student_Name to be

SELECT qryNameTel.StudentName FROM qryNameTel;


query was same as above post.
 

Users who are viewing this thread

Back
Top Bottom