john.hardy.7715@rogers.com (John Hardy) wrote in message news:<3f4d8b08.0401261536.4f0e1c23@posting.google. com>...[color=blue]
> I have the following SQL code in my databse as a querry.
>
> SELECT Sheet1.ID, Sheet1.Field6, Sheet2.ID, Sheet2.Field6
> FROM Sheet1 INNER JOIN Sheet2 ON Sheet1.ID = Sheet2.ID
> WHERE ((([Sheet2]![Field6])<>[Sheet1]![Field6] Or ([Sheet2]![Field6])
> Is Null));
>
> Which does what I want. But I would prefer rather then hard code the
> table name I would rather a dialog box pop up and ask for a table name
> or browse for one. I have no idea how to do this with SQL. Any help
> would be appreciated. I am not a programmer but I am writing something
> I need done and taking a long time doing it, so answer as layman as
> possible or with examples if you can.
>
> Much appreciated!
>
> Thanks
>
> John[/color]
there are various ways of showing a list of tables in a combobox...
then you could have a temporary querydef and execute it... Where are
the tables you are referring to? Are they Excel sheets that you are
linking to? You can use the code here...
http://www.mvps.org/access/api/api0001.htm ... to prompt the user to
search for a non-Access table... then you'd have to manipulate the
SQL property of the querydef (Access query) in code, save the changes,
and then open the query. If you're not a programmer, then this will
be an uphill battle, because as far as I know, there's no way to
specify a table you want to query on the fly without some kind of code
to build the SQL statement and then assign that string as the SQL
property of a QueryDef (query definition). I could be wrong, but I
don't think so.