Hi:
I have the following situation:
I have a form called Events(based on an Events table) and a subform called Participant_line(based on a Participant_line table).
The Events form has a field Event_id while the Participant_line form has an Event_id and Participant_id fields.The two forms are linked with the Event_id. The Participant_line form links Participants to Events. (it gets a Participant_id from a Participants table).
Now, when I add an Event and then link it with Participants (ie add) it works fine. However, when I try to delete a participant from the link table ie from the Participant_line table, it doesnt do it correctly. Sometimes it deletes a wrong person, and sometimes it says that it is deleting a row, when it actually doesn't (or at least I cannot find out what it deletes).
Under a button on the subform I have the following SQL statement:
delete from Participant_line where Event_id=Form!Event_id and Participant_id = Form!Participant_id
The way I choose the participant to delete is that first I select an event in the Events form and then I choose the participant from a combo-box (on the Participant_line form) whose datasouce is participant_id.
Can anyone help me.
Thanks in advance.
I have the following situation:
I have a form called Events(based on an Events table) and a subform called Participant_line(based on a Participant_line table).
The Events form has a field Event_id while the Participant_line form has an Event_id and Participant_id fields.The two forms are linked with the Event_id. The Participant_line form links Participants to Events. (it gets a Participant_id from a Participants table).
Now, when I add an Event and then link it with Participants (ie add) it works fine. However, when I try to delete a participant from the link table ie from the Participant_line table, it doesnt do it correctly. Sometimes it deletes a wrong person, and sometimes it says that it is deleting a row, when it actually doesn't (or at least I cannot find out what it deletes).
Under a button on the subform I have the following SQL statement:
delete from Participant_line where Event_id=Form!Event_id and Participant_id = Form!Participant_id
The way I choose the participant to delete is that first I select an event in the Events form and then I choose the participant from a combo-box (on the Participant_line form) whose datasouce is participant_id.
Can anyone help me.
Thanks in advance.