Use listbox for open recordset

T

Tiziana Venturini

I need to open recordset with a values of a listbox:

My code:
Dim strCriterio As String
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()

Set rs = db.OpenRecordset("Select * from Service where" _
& " Num_Civ= & Me!Liste44.Column(2)")

strCriterio = ""
rs.MoveFirst
While Not rs.EOF
strCriterio = strCriterio & " " & rs!COD_VIA & "/" & rs!NUM_CIV & "/" &
rs!BIS & "/" & rs!INT & "/" & rs!LET & "/" & rs!NUM_SECOND
rs.MoveNext
Wend
...........................

It doesn't work!!

Any idea?

Thank

Tiziana Venturini
 
M

Matthew Sullivan

In what way does it not work? Do you get error messages? What is the
expected behavior versus the observed behavior?

-Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top