- Local time
- Today, 19:53
- Joined
- Feb 19, 2013
- Messages
- 17,572
re parentheses there are an even number - not sure where to are looking but if you count them (in a working query) there will be the same number of lefts and rights.
There are a number of differences between docmd.runsql and currentdb.execute, however the main ones are:
Note that currentdb.recordsaffected will always return 0 - for a full explanation - this link will explain a bit more http://stackoverflow.com/questions/3004153/currentdb-recordsaffected-returns-0-why
There are a number of differences between docmd.runsql and currentdb.execute, however the main ones are:
- The former will prompt you that it is about to update x number of records etc whilst the latter doesn't.
- To get over this you would use docmd.setwarnings = true or false to turn these messages off
- if you specify a variable as a db and assign currentdb to it then you can make use of the recordsaffected value to advise how many records have been affected which is useful for progress reporting e.g.
Code:
Dim Mydb as database
set mydb=currentdb
mydb.execute("Update myTable....")
msgbox mydb.recordsaffected & " records have been updated"
set mydb=nothing