G
Guest
I am developing a form that shows behavior I don't understand. I have an
unbound master form which contains three subforms, a few combo boxes, some
textboxes, several command buttons, etc.. The first subform is bound to a
lookup table. The second and primary subform is designed to always be bound
to a record source (a multi-table query). The latter query contains a field
intended to hold any one of several potential table names. The current event
of the secoond bound subform is coded such that if the table name in the
latter field is one of a defined subset of names, the record source of the
third (originally unbound) subform is set to that table name (and a few other
things are done to format the third subform to the specific table). If the
table name is not one of the defined subset, then the recordsource of the
third subform is set to "". This works just fine when moving from one record
to another within the second bound subform. I can add a new record to the
second subform without trouble, and I can delete the second row (or lower)
record in the second subform without trouble. However, if I try to delete the
first row in the second subform, I get run-time error 2074, "Operation not
supported within transactions." Choosing Debug in the error message points me
to the line of code in the Current event of the second subform where I am
trying to reset the record source of the third subform. I don't understand
why this would be a problem just because I am trying to delete the first
record in the second subform. If I choose End in the error message, I get the
Delete Confirm message and the record does indeed "seem" to be deleted.
There is another problem I sometimes experience with this form. I don't know
if it is related but I mentioned it in a separate post. I thought I had
gotten around it before but it has reappeared at the same time I started to
experience this delete problem. Sometimes when I open the form, the record
pointer does not appear on the left side of the subforms and I cannot select
any control in the form. Sometimes when this happens, this problem will go
away if I merely change to design view and then backagain to form view. Yet
this doesn't always work either. Can anyone she light on these behaviors?
Thank you very much.
unbound master form which contains three subforms, a few combo boxes, some
textboxes, several command buttons, etc.. The first subform is bound to a
lookup table. The second and primary subform is designed to always be bound
to a record source (a multi-table query). The latter query contains a field
intended to hold any one of several potential table names. The current event
of the secoond bound subform is coded such that if the table name in the
latter field is one of a defined subset of names, the record source of the
third (originally unbound) subform is set to that table name (and a few other
things are done to format the third subform to the specific table). If the
table name is not one of the defined subset, then the recordsource of the
third subform is set to "". This works just fine when moving from one record
to another within the second bound subform. I can add a new record to the
second subform without trouble, and I can delete the second row (or lower)
record in the second subform without trouble. However, if I try to delete the
first row in the second subform, I get run-time error 2074, "Operation not
supported within transactions." Choosing Debug in the error message points me
to the line of code in the Current event of the second subform where I am
trying to reset the record source of the third subform. I don't understand
why this would be a problem just because I am trying to delete the first
record in the second subform. If I choose End in the error message, I get the
Delete Confirm message and the record does indeed "seem" to be deleted.
There is another problem I sometimes experience with this form. I don't know
if it is related but I mentioned it in a separate post. I thought I had
gotten around it before but it has reappeared at the same time I started to
experience this delete problem. Sometimes when I open the form, the record
pointer does not appear on the left side of the subforms and I cannot select
any control in the form. Sometimes when this happens, this problem will go
away if I merely change to design view and then backagain to form view. Yet
this doesn't always work either. Can anyone she light on these behaviors?
Thank you very much.