Form to run query Error 2001

W

woods1119

I created a query to run with a form using the example at
htto://office.micorsoft.com/en-us/assistance/HA011170771033.aspx?

the code for the OK button is

Private Sub OK_Click()
Me.Visible = False
Docmd.OpenQuery "Breed Summary Query", acViewNormal, acEdit
DoCmd.Close acForm, "Breed Summary Form"
End Sub

I am getting error 2001 "you canceled your previous action".

Any help would be great! Thanks!
 
A

Allen Browne

This message can indicate that there is a problem with the query you tried
to open.

Does the query work if you open it directly from the Database window?

This might also help identify the problem:
1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact
 
Top