Update a read-only recordset

J

jacksonmacd

Main form contains a subform (datasheet view) that is based on a
read-only recordset. A new requirement has added another field to the
recordset that must be updated by the user. The field values will
always be 0, 1, 2, or 3. I was hoping to allow the user to select an
arbitrary number of records in the subform to be updated, then perform
some action (click a button, select from a combo box, select a radio
button, etc) that would update the underlying table via VBA. But I
can't figure out how to do that...

Any suggestions? Using A2003.
 
J

jacksonmacd

Thanks, Chris. I was unaware of the SelHeight property, so that's a
step in the right direction. I am still stuck, though, because I don't
understand is how to fire an event from a control and still have the
selection active.

Found this article:
http://support.microsoft.com/kb/294202
that seems to deal with the problem of retaining a reference to the
selected rows, but haven't yet got it running properly. It seems
rather complex to be able to refer to the selected records in a
subform.

Am I overlooking something simple?
 
J

jacksonmacd

Excellent! I kinda figured there was a way to do it by using a custom
property of the form, and using the form's Click event to set the
property value is simpler than the example that I found. Thanks very
much!
 
J

jacksonmacd

Chris - one more detail. The Click event fires when the subform's
record-selector is clicked. Select a range of records, and the
DSSelHeight property is set accordingly. Works exactly as needed.

However, if the user then clicks in a record, thus removing the
selection, the Click event does not fire and the DSSelHeight property
contains an incorrect value. I played around with using the Current
event to set the DSSelHeight Property to zero under those conditions,
but it introduced its own set of problems.

Do you know of a way to erase the DSSelHeight property (ie, set it to
zero) when the user deliberately "unselects" all the records?
 
J

jacksonmacd

Thanks, Chris. But don't spend a lot of time on it -- I can live with
it as-is. As you said, creating a button to clear the item is really a
non-starter...

Also tried the MouseUp event. Thought it might fire when the user
clicks in a datasheet cell, but it also fires only when the record
selector is clicked.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top