We have a bunch of queries already made that ask for one parameter. I can do something as basic as use the macro tool in Access to execute said queries. But how do I automate putting in the value (which is fixed) in the dialog box and run the query?
I have to run each query 6 times, one time for each thing I have to look for.
And here is the parameter query execute line in VBScript:
DoCmd.OpenQuery "QUERY", acViewNormal, acEdit
So right now, I have to run query, type in parameter, print output, and so forth 6 times for each query, 16 queries.
Right now this just asks for the parameter, so user interaction is required. Google is not helping with this very basic question as it's almost too basic to even get a hit.
Last edited by Joust Williams; 20 Nov 2008 at 12:46 PM.
I think you have to write a vb program (within access) to do that, but I have never done it.
Or what about this
Here's what the query is now:
SELECT x.cow, x.[blah blah], x.beh, x.[beh beh], x.meow, x.[boo boo], x.beee, x.[bah bah]
FROM x
WHERE (((x.cow)=[Enter the parameter here]) AND ((x.beee)="stuff"))
ORDER BY x.[bah bah];
Can I write a new query in VB that basically looks like this?
For i = 1 to 6
If i = 1 then NameCompare = "John Doe"
.
.
If i = 6 then NameCompare = "Joan Walker"
QUERYFOO=the above but instead of parameter, it is the variable NameCompare
Exceute Query --> DoCmd.OpenQuery "QUERYFOO", acViewNormal, acEdit
Print Results
Next i
The problem is I don't know the syntax of the assigning of the query statement...first I don't know anything about variables in SQL and second even if I copy a working query into VB it does not compile
Last edited by Joust Williams; 20 Nov 2008 at 03:27 PM.
I googled this shit:
Here is the topic, you can download some examples there if you are still having trouble.Originally Posted by JOUST IS A NOOB
Last edited by kingoffighters; 20 Nov 2008 at 03:36 PM.
So does it work Joust?
joust actually meant he wanted to use his queer-eye to make a pass into a Virile Boy's Anus
I dunno if it works. It should work, but I haven't tried it. Thanks though
Bookmarks