ACCESS VBA using using one more SQL QUERY in WHERE clause -



ACCESS VBA using using one more SQL QUERY in WHERE clause -

i have 2 tables, 1 std table , keytable. have display values of std table based on status of keytable. example, if user selects asia, have create sql query list of countries in asia , utilize country values (example: india,srilanka,bangladesh) clause in final query. have tried building them. not sure of syntax

first query filter out values of asia

strsql1 = "select keytable.[lead country] keytable keytable.country='" & lstcountry & "';"

second query display values according first query in clause

strsql = "select * [std table] ([std table].country in (______));

the blank missing.

you combine 2 queries 1 statement:

strsql= "select * " & _ "from [std table] " & _ "where [std table].country in " & _ "(" & _ " select s.[lead country] " & _ " keytable s s.country = '" & lstcountry & "' " & _ ")"

sql vba

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -