Use result from one listbox in another.

shkrebs

Registered User.
Local time
Today, 18:00
Joined
Jun 7, 2002
Messages
60
Hi there.

Just can't find the right syntax...

I got two listboxes. The first contains 2 catagories and the second is supose to contain the records of the catagories.
I'm using a simple SQL in box2 to select the records, and I want to use the value from Box1 in my WHERE clause - but I can't make it work ....
Can anybody see what's wrong?

SELECT [Cabecera Facturacion].Numero FROM [Cabecera Facturacion] WHERE [Cabecera Facturacion].Serie= " & [Me]![Cuadro combinado15] & " ORDER BY [Cabecera Facturacion].Numero;

Box1 = Cuadro combinado11
Box2 = Cuadro combinado15
Table= Cabecera Facturacion

Best regards
Soren
 
Try:

SELECT [Cabecera Facturacion].Numero FROM [Cabecera Facturacion] WHERE [Cabecera Facturacion].Serie= [Me]![Cuadro combinado11] ORDER BY [Cabecera Facturacion].Numero;


ie: Your second box Rowsource is based on the firstbox output (not itself)

HTH

Brad.
 
Thanks Brad.

It was some of the problems, others was that I didn't used a filter and the REQUERY command.

It's amazing what you can use the demo-bases for :-)))))

Regards
Soren
 

Users who are viewing this thread

Back
Top Bottom