Hi, can anyone help with this:
I have 2 tables, customer and contact. There is only 1 record per customer in the customer table but many entries in the contact table for the same customer. I have created a main customer form with a subform for that customer's contacts. This works fine & displays only the contacts for that customer. I have put a check box in the contacts subform so the user can pick which contact should be used. This works fine but doesn't uncheck previously checked contacts for that customer. I only want 1 contact to be checked at any one time. I tried to do an update query to set all contacts for that customer to 0, as a before update event of the check box, thinking they would be set to 0 then only one would be checked. However, when I run this it sets the contact check box for all customers on the database to 0 rather than just the customer shown on the main form. The subform has the child and master fields linked, it's just the check box that I can't sort out.
Is there any way to do this? I hope this makes sense to someone! Any help gratefully received.
I have 2 tables, customer and contact. There is only 1 record per customer in the customer table but many entries in the contact table for the same customer. I have created a main customer form with a subform for that customer's contacts. This works fine & displays only the contacts for that customer. I have put a check box in the contacts subform so the user can pick which contact should be used. This works fine but doesn't uncheck previously checked contacts for that customer. I only want 1 contact to be checked at any one time. I tried to do an update query to set all contacts for that customer to 0, as a before update event of the check box, thinking they would be set to 0 then only one would be checked. However, when I run this it sets the contact check box for all customers on the database to 0 rather than just the customer shown on the main form. The subform has the child and master fields linked, it's just the check box that I can't sort out.
Is there any way to do this? I hope this makes sense to someone! Any help gratefully received.