This is driving me mad. I am new to VB and I am sure that this is something very simple. Please tell me why the code example 1 works and code example 2 does not when they ought to be doing the same thing.

----------------------------
This works:

Set rs = db.OpenRecordset("SELECT * FROM Street " _
& "WHERE (street.Provincia_ID = 3)")


-----------------------------
This gives run time error 3061 ("Too few parameters. Expected 1"):

dim workint as integer
workint = 3

Set rs = db.OpenRecordset("SELECT * FROM Street " _
& "WHERE (street.Provincia_ID = workint)")

----------------------------
As you can see, the only difference is that instead of the number 3 I am using a variable workint which I had set to 3 previously.

street.provincia_ID is defined as integer in the database.

Please help, is there any syntax problem or something.