problem with connecting query and combo box

E

eleftheriak

Hello to all,


I m trying to get the job_no from a text field of my form and put the
title of that job in a combo box by doig a select statement .

SELECT Trying.title FROM Trying WHERE
[Trying.job_no]=Forms.qViewJobs.job_no;
But this code just gives me only 1
record. It does seem that select does not work. Any ideas? I put inside

the combo box the select statement is that right?


Thanks in advance


Riri
 
E

eleftheriak

I have a table that has some information about titles of jobs.

that table is

j7001 hhhhh
j7001 kjjkjh
j9809 skjhfj

Ihave the job no on my form and i want to have for the j7001 the combo
box saying the hhhhh and kjkjkjkh titles. That's all.

Thanks in advance

Riri
 
A

Arvin Meyer [MVP]

It appears you are trying to get multiple results from a single value.

Try the following:

SELECT job_no, title FROM Trying WHERE [job_no]=Forms.qViewJobs.job_no;

Change the combo to a 2 column combo and set the first column to 0 width.
You will see both entries in the combo. If the combo is bound to a field,
after you choose 1 of the entries and come back to the record later on,
there will only be the first value. That's because the first value resolves
the Where clause.

If you use a subform to display the results in a second table, you'll get
what you want.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Top