How to edit in a subform

  • Thread starter Thread starter StuTheDog
  • Start date Start date
S

StuTheDog

This is probably something simple. I am programmatically setting the
recordset property of a subform to display the appropriate details for the
main form. I want to edit just a couple fields so have set the others to
enabled=false. For the editable fields the system beeps when I try to enter
a value. Thanks in advance.
 
StuTheDog said:
This is probably something simple. I am programmatically setting the
recordset property of a subform to display the appropriate details
for the main form. I want to edit just a couple fields so have set
the others to enabled=false. For the editable fields the system
beeps when I try to enter a value. Thanks in advance.

Are you really setting the Recordset property (to a recordset you've
created), or are you setting the RecordSource property? If the former,
I seem to recall that you normally get a read-only recordset when you do
that. Can you set the RecordSource property instead, to a SQL SELECT
statement that extracts the records you want?
 
Thanks, I've tried both ways. I can get the form to allow edits if my
recordsource is a table, however I need the functionality of a
query/recordset. Reading the doc implies that an ADO rs will allow edits
however that didn't work either.
 
StuTheDog said:
Thanks, I've tried both ways. I can get the form to allow edits if my
recordsource is a table, however I need the functionality of a
query/recordset. Reading the doc implies that an ADO rs will allow
edits however that didn't work either.

Check the query itself to make sure it's updatable. Depending on how
you construct them, some queries are not updatable. Open the query
itself as a datasheet and see if you can update/add records. If not,
look into the design of the query, with reference to the help topic
"When can I update data from a query?"
 
Got it, turns out since the query contained a join to a table in another
database I had to open the recordset with the dbInconsistent option.
Setting the form's recordset member works fine.
 
Back
Top