I have 3 imported tables. I am trying to write a VB program in Access that will create a query (or table or recordset) from each table then union the queries. I have several criteria I want included in the WHERE statements that can be omitted or defined by the user. All three queries use the same criteria. I do not want the queries to save because they are not going to be used again and Access will not write over a query if you name it the same in a program. I had to name the queries like this: "qryPt1" & int(timer), so after running to program a few times you end up with several useless saved queries.
I have tried using recordsets, but they can not be used in the union query (the SQL statement is referenced not the name of the recordset and the SQL statements behind the recordsets are too long and get cut off).
I have tried using a parameter query, but the user must enter a valid parameter for each criteria for all three queries (can't leave any blanks).
I have also looked into using an append query.
Any suggestions are welcome.
Thank you,
Susan
I have tried using recordsets, but they can not be used in the union query (the SQL statement is referenced not the name of the recordset and the SQL statements behind the recordsets are too long and get cut off).
I have tried using a parameter query, but the user must enter a valid parameter for each criteria for all three queries (can't leave any blanks).
I have also looked into using an append query.
Any suggestions are welcome.
Thank you,
Susan