yes, you can go:
Public Sub MyTest
BeginTrans
CurrentDB.Execute "insert into mytable(col1, col2, col3) " & _
" values (1,2,3)",dbFailOnError
CurrentDB.Execute "insert into mytable(col1, col2, col3) " & _
" values(2,3,4)",dbFailOnError
If MsgBox("Do you want to actaully do these updates ? ", _
vbYesNo) = vbYes Then
CommitTrans
Else
Rollback
End If
end sub
I used the line continuation character above. You can also just as well used
saved queries, and used the same as above.
BeginTrans
CurrentDB.Execute "query1"
CurrentDB.Execute "query2"
If MsgBox("Do you want to actaully do these updates ? ", _
vbYesNo) = vbYes Then
CommitTrans
Else
Rollback
End If
Anyone who has played around with the basic programming language could
certainly in a few minutes write some code to read a text file, and then
use the above idea of currentdb.Execute to run each line of the
text file. The result would be that you can run sql scripts.
You can also whack ctrl-g, and type the sql statements directly into the
debug window interactive at a command prompt also using
docmd.runSql "your sql"
The above is automatically wrapped in a transaction for you. Or, you can use
currentdb.Execute "your sql"