Ad-Hoc Select query in VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to run an ad-hoc Select query from VBA, and show the results
to the user?
I tried DoCmd.RunSQL, then discovered that only works with action queries.
I tried creating a querydef and running it with DoCmd.OpenQuery, and got a
wrong datatype error. I can't find anything more in the help that looks
promising.

I've taken over a database with a form with many possible selections, and it
has 32 almost identical queries that are run according to the user
selections, and each one reads 11 different fields from the form -- most of
which are normally set to "None" in a VBA procedure if the user didn't check
the relevant check box. I need to make an unknown number of structural
changes to the database, and I would rather maintain just the VBA instead of
having to update 32 almost identical queries every time!!!
 
Never mind!! I removed the word "temporary" from my search string, and found
the answer in a thread from last week. ("Use VBA to Create a Select Query").
Too bad I can't find a way to remove my post....
 
Back
Top