Get rid of auto message when about to update query

G

Guest

I want to get rid of the code that is making the alert msg box pop up (access help) when I am about to update records

How can I do this
I'm not sure which code to delete

Here is the code

Private Sub runUpdateQuery_Click(

On Error GoTo Err_runUpdateQuery_Clic

Dim stDocName As Strin

stDocName = "qryUpdateIndCSZ
DoCmd.OpenQuery stDocName, acNormal, acEdi

Exit_runUpdateQuery_Click
Exit Su

Err_runUpdateQuery_Click
MsgBox Err.Descriptio
Resume Exit_runUpdateQuery_Clic

End Su

I'm assuming it has to do with the MsgBox Err.Description line - but if some pros could help me out, I'd appreciate it

Thanks!
 
F

fredg

I want to get rid of the code that is making the alert msg box pop
up (access help) when I am about to update records.

How can I do this? I'm not sure which code to delete.

Here is the code.

Private Sub runUpdateQuery_Click()

On Error GoTo Err_runUpdateQuery_Click

Dim stDocName As String

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

Exit_runUpdateQuery_Click:
Exit Sub

Err_runUpdateQuery_Click:
MsgBox Err.Description
Resume Exit_runUpdateQuery_Click

End Sub

I'm assuming it has to do with the MsgBox Err.Description line -
but if some pros could help me out, I'd appreciate it.

Thanks!

Don't assume!!!

Just add 2 lines,
DoCmd.SetWarnings False ' Turn warnings off
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings True ' Turn warnings back on
 
C

chris

Try ...

Private Sub runUpdateQuery_Click()

On Error GoTo Err_runUpdateQuery_Click

Dim stDocName As String

stDocName = "qryUpdateIndCSZ"
DoCmd.SetWarnings false
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings True

Exit_runUpdateQuery_Click:
Exit Sub

Err_runUpdateQuery_Click:
MsgBox Err.Description
Resume Exit_runUpdateQuery_Click

End Sub

DoCmd.SetWarnings True
-----Original Message-----
I want to get rid of the code that is making the alert
msg box pop up (access help) when I am about to update
records.
How can I do this?
I'm not sure which code to delete.

Here is the code.

Private Sub runUpdateQuery_Click()

On Error GoTo Err_runUpdateQuery_Click

Dim stDocName As String

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

Exit_runUpdateQuery_Click:
Exit Sub

Err_runUpdateQuery_Click:
MsgBox Err.Description
Resume Exit_runUpdateQuery_Click

End Sub

I'm assuming it has to do with the MsgBox Err.Description
line - but if some pros could help me out, I'd appreciate
it.
 

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