By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,157 Members | 891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,157 IT Pros & Developers. It's quick & easy.

"You cancelled the previous Operation error"-HELP??

P: 8
I have the code below to run a query, that is created from a "fill in the blanks" form. I am now getting the error "You cancelled the previous operation"

Earlier when I got this I closed the database and open it and the query ran, now it does not run. As far as the form is concerened no "cancellation" was done.

Any ideas, since the message is so generic, I can't find what it is referring to.

Dim db As DAO.database
Dim qdf As DAO.QueryDef
Dim strSQL As String

Set db = CurrentDb
Set qdf = db.QueryDefs("qrytest1")
strSQL = Forms!frmReportsMYO.txtQry
qdf.SQL = strSQL

DoCmd.OpenQuery ("qrytest1")

Thanks for the help!

PW
Oct 10 '07 #1
Share this Question
Share on Google+
1 Reply


nico5038
Expert 2.5K+
P: 3,072
I have the code below to run a query, that is created from a "fill in the blanks" form. I am now getting the error "You cancelled the previous operation"

Earlier when I got this I closed the database and open it and the query ran, now it does not run. As far as the form is concerened no "cancellation" was done.

Any ideas, since the message is so generic, I can't find what it is referring to.

Dim db As DAO.database
Dim qdf As DAO.QueryDef
Dim strSQL As String

Set db = CurrentDb
Set qdf = db.QueryDefs("qrytest1")
strSQL = Forms!frmReportsMYO.txtQry
qdf.SQL = strSQL

DoCmd.OpenQuery ("qrytest1")

Thanks for the help!

PW
I guess the form that's triggering this code is "bound" to a table. Access now thinks you're not storing the changes on this form when you start executing another query.
You can try to use an unbound form, or issue a comand like:
DoCmd.Runcommand accmdSaveRecord
to force Access to "free" the current record processing.

Nic;o)
Oct 10 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.