SendKeys

  • Thread starter Thread starter Joss
  • Start date Start date
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
 
use
docmd.setwarnings false
before you run query and after it set warnings back:

docmd.setwarnings true
 
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
 
Back
Top