A
Amit
MS Access, Windows XP
==================
Hi,
I'd posted this yesterday, and am reposting it in case it slipped through
the cracks
I have a form with a subform. Depending on how this form is opened, I'm able
to delete records in the subform in one instance, but when I try to delete a
record in the second instance, I get a message in the status bar at the
bottom "Records cannot be deleted. Data is read-only."
I'm totally confused by this, and would love an explanation/solution.
In the second instance when I'm unable to delete the record from the
subform, I am able to delete the same record from the query that is the
record source for the subform, or from the table that the query is based on.
There is only one table for that query.
In the first instance (when I am able to delete the record), the form is
opened by clicking on a "Add New Committee" button in another form. I add the
name of the committee (which is a required field) and then go to the subform
to select the names of people who are members of the committee. The Primary
key for this table (the subform) is (CommitteeID + MemberID).
When I select the members of the newly added committee, the records show up
in the table. I can delete a record from the subform with no problem.
In the second instance (when I'm unable to delete the record), the same form
is opened by double-clicking on the name of the committee in another form.
Now, when I try to delete a record, I get the message "Records cannot be
deleted. Data is read-only.".
It's the same form being opened, and none of the properties of the form or
the subform are changed. The Allow Additions, Allow Edits and Allow Deletions
are set to True. I even checked the value of these properties by using Msgbox
to output them and in both instances, they are True.
There is no other code in any of the events of the form that would cause
this to happen. The query remains the same in both instances.
Oh, another thing is that in the second instance, I'm unable to add new
members to an existing committee.
If you would like more information, please let me know. At this point, I've
given up on brainstorming a solution, and maybe a fresh set of eyes (and
brain) will help.
The other way would be to create a new form (for the second instance) with 2
buttons: "Add member" and "Delete member" with SQL code behind them to
add/delete a member programatically.
Thanks for any help.
-Amit
==================
Hi,
I'd posted this yesterday, and am reposting it in case it slipped through
the cracks
I have a form with a subform. Depending on how this form is opened, I'm able
to delete records in the subform in one instance, but when I try to delete a
record in the second instance, I get a message in the status bar at the
bottom "Records cannot be deleted. Data is read-only."
I'm totally confused by this, and would love an explanation/solution.
In the second instance when I'm unable to delete the record from the
subform, I am able to delete the same record from the query that is the
record source for the subform, or from the table that the query is based on.
There is only one table for that query.
In the first instance (when I am able to delete the record), the form is
opened by clicking on a "Add New Committee" button in another form. I add the
name of the committee (which is a required field) and then go to the subform
to select the names of people who are members of the committee. The Primary
key for this table (the subform) is (CommitteeID + MemberID).
When I select the members of the newly added committee, the records show up
in the table. I can delete a record from the subform with no problem.
In the second instance (when I'm unable to delete the record), the same form
is opened by double-clicking on the name of the committee in another form.
Now, when I try to delete a record, I get the message "Records cannot be
deleted. Data is read-only.".
It's the same form being opened, and none of the properties of the form or
the subform are changed. The Allow Additions, Allow Edits and Allow Deletions
are set to True. I even checked the value of these properties by using Msgbox
to output them and in both instances, they are True.
There is no other code in any of the events of the form that would cause
this to happen. The query remains the same in both instances.
Oh, another thing is that in the second instance, I'm unable to add new
members to an existing committee.
If you would like more information, please let me know. At this point, I've
given up on brainstorming a solution, and maybe a fresh set of eyes (and
brain) will help.
The other way would be to create a new form (for the second instance) with 2
buttons: "Add member" and "Delete member" with SQL code behind them to
add/delete a member programatically.
Thanks for any help.
-Amit