Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create a button to run a query and I get a macro

Status
Not open for further replies.

DSFord

Programmer
Oct 3, 2006
4
CA
On a form I create a new button and take options to run a query. It creates a macro to run the query I wanted. I expected to see a click event with:

stDocName = "#04a my query name here"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Thanks,
Doug
 
You may convert the macro to VBA if you prefer

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How are ya DSFord . . .

Surely [blue]"#04a my query name here"[/blue] is not a query name ... albeit even in a macro? ...

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
If you let Access convert the macro to VBA, you get very generic VBA. You may want to clean it up a bit so it's easier to read.

If the square peg won't fit in the round hole, sand off the corners.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top