No message on update Query

Pappy

Registered User.
Local time
Today, 11:09
Joined
Jun 12, 2003
Messages
28
I know you can turn on the message prompt on the whole database using Tools...Options. How could I have the prompt not show up just on one particular update query that runs when a form is opened. Thanks in advance
Paps
 
If you run the update query from VBA code, it should not give you any warning messages.
 
I am running it from VB code,
Dim stDocName As String

stDocName = "UPQryJuly"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Command34_Click:
Exit Sub

Err_Command34_Click:
MsgBox Err.Description
Resume Exit_Command34_Click

But the prompt still pops up.
 
Aha, I see the problem. You are loading the update query which does in fact cause Access to prompt you. What you want is to tell Access to execute the query.

Instead of the DoCmd command, use something like this if you're running Access 97 with DAO:
Currentdb.Execute stDocName

If you're using Access 2000+, mostly likely this command will work:
CurrentProject.Connection.Execute stDocName
 
DoCmd.SetWarnings False
DoCmd.OpenQuery "UPQryJuly"
DoCmd.SetWarnings True
 

Users who are viewing this thread

Back
Top Bottom