pterodroma
New member
- Local time
- Today, 09:03
- Joined
- Jun 3, 2011
- Messages
- 3
I am using VBA in Access 2003 to perform updates to a collection of tables.
All but one of my updates succeed, however this particular update does not fail, but does not update any rows.
db.Execute "Update tempflightheight, flightdetails Set tempflightheight.flight_id = flightdetails.flight_id where tempflightheight.flight_id = flightdetails.tempflight_id;", dbFailOnError
When I extract the update statement and run it as a Query in Access it succeeds so the logic of the query appeato be correct.
I have tried changing the syntax of the join to be 'inner join', using 'Docmd.runsql' rather than 'db.Execute' but with similar results
It seems to be an issue with the where clause as this statement successfully updates rows:
db.Execute "Update tempflightheight, flightdetails Set tempflightheight.flight_id = 2000", dbFailOnError
but this doesn't:
db.Execute "Update tempflightheight, flightdetails Set tempflightheight.flight_id = 2000 where tempflightheight.flight_id = flightdetails.tempflight_id;", dbFailOnError
Any help or ideas much apprieciated.
Thanks
All but one of my updates succeed, however this particular update does not fail, but does not update any rows.
db.Execute "Update tempflightheight, flightdetails Set tempflightheight.flight_id = flightdetails.flight_id where tempflightheight.flight_id = flightdetails.tempflight_id;", dbFailOnError
When I extract the update statement and run it as a Query in Access it succeeds so the logic of the query appeato be correct.
I have tried changing the syntax of the join to be 'inner join', using 'Docmd.runsql' rather than 'db.Execute' but with similar results
It seems to be an issue with the where clause as this statement successfully updates rows:
db.Execute "Update tempflightheight, flightdetails Set tempflightheight.flight_id = 2000", dbFailOnError
but this doesn't:
db.Execute "Update tempflightheight, flightdetails Set tempflightheight.flight_id = 2000 where tempflightheight.flight_id = flightdetails.tempflight_id;", dbFailOnError
Any help or ideas much apprieciated.
Thanks