How to stop the dialog box from showing up when running append que

K

kfng

I have the following codes to insert new data into a table:

For i = 1 To .FoundFiles.Count
datafile_name =
Right(.FoundFiles.Item(i), Len(.FoundFiles.Item(i)) -
InStrRev(.FoundFiles.Item(i), "\"))
datafile_name = Left(datafile_name,
InStrRev(datafile_name, ".") - 1)
PlateID = Mid(datafile_name,
InStr(datafile_name, "R") + 1, InStrRev(datafile_name, "R") -
InStr(datafile_name, "R") - 1)
RA = Right(datafile_name,
Len(datafile_name) - InStrRev(datafile_name, "R") + 1)
PlateID = CStr(CurrentReq) & "_PCR_" &
PlateID & "_" & RA
'Debug.Print datafile_name, PlateID
'generate SQL command to insert the two
new records
SQL = "Insert into tblPCRsetup
(PCRfile,plateID) values('" & datafile_name & _
"','" & PlateID & "')"
'Refresh query and set up new appendquery
DoCommand.RunSQL SQL
Next i

It's doing the job but a dialog box will show up with each iteration, asking
me to confirm inserting the data into a table. How can I get rid of this.
Thanks!
 
J

JamesDeckert

docmd.SetWarnings false

make sure you turn them back on when you are done (even if an error occurs).

James
 

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