Updating a recordset that was opened using a query

  • Thread starter Thread starter Deborah
  • Start date Start date
D

Deborah

OK I have a record set being opened based on the following
lines:
strCrit = "SELECT * FROM qryPub WHERE [PubID] = " &
pidOverall

rst1.Open strCrit, thisCN1, adOpenKeyset,
adLockOptimistic, adCmdText

where "qryPub" is a premade query in Access. I want to
update the record that I get from this recordset. The
books I have looked at have updating only done where the
recordset is based on a table, not a query. How do I get
my tables that are involved in the query to update
correctly?

Thanks
 
You can only update a recordset based on a query if the query itself is
updateable. You can tell this by running the base query on its own and
looking at the status bar on the bottom of the window. It will say whether
it is updateable or not. If not you are out of luck. You will need to
modify your original query and make sure it is updatable. Thats why your
books say you need to use a table, since a table is always updatable.

Kelvin
 
Back
Top