SendKeys

J

Joss

I would like a make table query hidden from the main
screen upon the event procedure command button. However,
three pop up menus come up when I try my code telling me
that
1. I am running a make table query . . .
2. The existing table will be deleted . . .
3. I will paste 14 rows into new table

I have entered the SendKeys "yyy", True line but this is
not helping. Any suggestions? Below is my code:

Private Sub Command109_Click()
On Error GoTo Err_Command109_Click

Dim stDocName As String
Dim stLinkCriteria As String

DoCmd.OpenQuery "qryAIP40Crosstab", acViewNormal,
acReadOnly
SendKeys "yyy", True
DoCmd.Close acQuery, "qryAIP40Crosstab"

stDocName = "frmAIP40StartUp"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command109_Click:
Exit Sub
 
A

Alex Dybenko

use
docmd.setwarnings false
before you run query and after it set warnings back:

docmd.setwarnings true
 
T

Tim Ferguson

three pop up menus come up when I try my code telling me
that
1. I am running a make table query . . .
2. The existing table will be deleted . . .
3. I will paste 14 rows into new table

Use the Execute method:

Querydefs("qryAIP40Crosstab").Execute dbFailOnError


HTH


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top