this is reasonably simple to do. Do check out the SQL forum because excepting minor implementation specific tweaks, SQL is SQL whether against SQL server or Access. This is why you should use it, so that if you change you app to a different database it should work without problems.
As to your specific issue
SQL queries are merely srtrings, So you simply glue a string together with the desired terms and variables forming a correct query and send it off to the interpreter. For example
dim ssql as string
ssql = "Select field1,field2 from table_name where " param1 & "=" & param2
then send ssql off to be interpreted by the SQL engine. Keep in mind that if the data mentioned in param one is a string then you must add single quotes to the mix.
For example if you wanted the query to be
Select field1, field2 from some_table where custname = 'smith'
This should work
dim param1 as string
dim param2 as string
dim ssql as string
param1 = "custname" (could be based on a choice made by user)
param2 = textbox1.text
ssql = "select field1,field2 from some_table where " & param1 & "='" & param2 & "'"
I would reccomend highly a good SQL book if you plan on using sqL commmands much. Mine has payed or itself many times over. SQL is a very powerful command language.
Debugging is the process of removing bugs. Programming is the process of putting them in.