Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View cannot be updated because modification affects multiple base tables

Status
Not open for further replies.

ShaimaaT

Programmer
Aug 18, 2014
16
EG
Hi all,

I am trying to trap the database error "View cannot be updated because modification affects multiple base tables" in the Form OnError event to display a user-friendly message instead of the above.

The above can happen in the scenario of inserting/updating several fields of different tables at one time, likewise what I am facing now is the scenario of the user copying an entire record and pasting it.

I tried
Case 4405
MsgBox "Can not update the record. it is related to base tables"
Response = acDataErrContinue

But it doesn't work. How can I know the case number and solve all the scenarios of multiple insert/update attempts?

Also, are there any better solution than this? I first tried to detach the SQL statements out of the views and make it one select statement so that I can normally multiple update/insert(as this problem happens with views only) but since CTE is not supported in Access , I failed to do so.

Any help with the above and/or ideas?
 
I trapped it using

Case 3155
MsgBox "Can not update the record. it is related to base tables"
Response = acDataErrContinue

But how can I "undo " the pasted record ?
 
Not really a SQL Server issue - maybe better help here: forum702

Beir bua agus beannacht!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top