Hi there.
I have been reading a looooot of posts regarding these subjects but I can't find a good ex. who helps me.
I've seen that Pat is allwas saying that "if you can - use Stored QueryDefs (SQ)" and I would love to - but I'm in doubt about how.
If I have understood SQ correctly then it's a query made in QBE and saved and then you are using VBA to send the WHERE clause to this query???
In my case I would like to use the data from a table as WHERE clause in a query, and I guess I shall "send" them as parameteres to the query. I have been trying with this model, but it doesn't work:
SQLstr1 = "PARAMETERS PSerie String, PNumero Integer; '" & SQLstr & "' ;"
Set Qdef = DBname.CreateQueryDef("TestQ", SQLstr1)
Using the debug I can see that the SQL is correct but the parameter block seems to be just like it's written here, and I get the message that A97 expects a SELECT, INSERT INTO etc. etc.
Can anybody give me a helping hand like an exsample on how to use this PARAMETERS function or how to make a SQ??
Thanks very much.
Soren
I have been reading a looooot of posts regarding these subjects but I can't find a good ex. who helps me.
I've seen that Pat is allwas saying that "if you can - use Stored QueryDefs (SQ)" and I would love to - but I'm in doubt about how.
If I have understood SQ correctly then it's a query made in QBE and saved and then you are using VBA to send the WHERE clause to this query???
In my case I would like to use the data from a table as WHERE clause in a query, and I guess I shall "send" them as parameteres to the query. I have been trying with this model, but it doesn't work:
SQLstr1 = "PARAMETERS PSerie String, PNumero Integer; '" & SQLstr & "' ;"
Set Qdef = DBname.CreateQueryDef("TestQ", SQLstr1)
Using the debug I can see that the SQL is correct but the parameter block seems to be just like it's written here, and I get the message that A97 expects a SELECT, INSERT INTO etc. etc.
Can anybody give me a helping hand like an exsample on how to use this PARAMETERS function or how to make a SQ??
Thanks very much.
Soren