omitting msgboxes by deleting-query

xxyy

Registered User.
Local time
Today, 02:33
Joined
Feb 24, 2006
Messages
51
Dear All,

Please help me in the following:

I have a VB code that automatically creates a table and then it deletes the same table, but message boxes pop up (when deleting) that isn't desirable...
What can I do to eliminate those popping-up-boxes?

Thank you in advance,

Sz.Cs.
 
amendment:

The problem occurs as well as running the table-creating query.
 
on begining of code put

DoCmd.SetWarnings = False

at the end put with true
 
Dear goppo,

Thanks for your help.

I tried it but something's wrong, the error message is 'Argument not optional'.

Sz.Cs.


Private Sub Parancsgomb12_Click()
Dim i As Integer
Dim r As Integer
Dim p As Integer
DoCmd.SetWarnings = False
DoCmd.OpenQuery "create", acViewNormal
DoCmd.SetWarnings = True
i = DCount("*", "REPORT", "ID=" & Forms!DELIVERIES!ID)
r = i
For r = 1 To i
p = DLookup("no_of_page_to_print", "REPORT", "numbering=" & r)
DoCmd.SelectObject acReport, "REPORT", True
If p <> 0 Then DoCmd.PrintOut acPages, r, r, acLow, p
MsgBox p
Next r
DoCmd.Close acTable, "REPORT"
DoCmd.OpenQuery "delete", acViewNormal
End Sub
 
sorry for my mistake... is without "="
DoCmd.SetWarnings False
 

Users who are viewing this thread

Back
Top Bottom