Hide "Do you want to append x rows" statement

electro

Registered User.
Local time
Today, 23:11
Joined
Sep 8, 2006
Messages
27
I have made an own copy button that make a copy of current order to a new order and also copys all it data. I am using INSERT INTO but I get "Do you want to append " box all the time. Is there someway to allways make answer yes or block it out so it doesnt show up?
 
DoCmd.SetWarnings False
INSERT INTO..........
DoCmd.SetWarnings True
 
you only get the warning message if you use docmd.runSQL

far better to use (Access 97 version)
Currentdb.execute Querynamr or SQL,dbFailOnError

if an error occurs and you have an on error......... then the code in the error label executes.
 
Thanks MStef

you only get the warning message if you use docmd.runSQL

far better to use (Access 97 version)
Currentdb.execute Querynamr or SQL,dbFailOnError
if an error occurs and you have an on error......... then the code in the error label executes.
Thanks for your answer but the problem is that I have not sucessfully transferedd it to an query.. it acctually two statements run after each other...

Code:
' This is the code for copying a record and its secondare table posts

 iTmp = IDOrders ' get current Orders IDOrder to copy
 sSQL = "INSERT INTO Orders(IDContact, strDate, strTime, strWhoOrdered, strComment, strComputer, bForget) VALUES (" & Me.Combo10.Value & ", #" & Date & "#, #" & Time & "#  , '" & objnet.UserName & "', '" & strComment & "', '" & objnet.ComputerName & "', No);"
    
    DoCmd.RunSQL sSQL
    DoCmd.Requery
    DoCmd.GoToRecord , , acLast
    
    iNewTmp = IDOrders ' Get the new IDOrder (this is not a good solution.. other suggestion appriated)
    
    sSQL = "INSERT INTO OrderedItems(IDItem, IDOrders, iNumber, strWho, strComment) SELECT OrderedItems.IDVara, " & iNewTmp & " , OrderedItems.iNumber, OrderedItems.strWho, OrderedItems.strComment FROM OrderedItems WHERE OrderedItems.IDOrders=" & iTmp
    
    DoCmd.RunSQL sSQL
 
Last edited:

Users who are viewing this thread

Back
Top Bottom