BradleyOnTheRoad
asked on
Access: Limit data entry and edits to only one record on a sub form
Is there a way to use datasheet view on a subform within an unbound mainform but only allow one record to be either added or edited?
For example, you can have zero records or a max of one record for the given parent/child relationship.
For example, you can have zero records or a max of one record for the given parent/child relationship.
I think you need to tell us a bit more about this. Firstly, if the main form is unbound, how can it have a parent/child relationship with the subform? And secondly, if there's an exact 1-to-1 correspondence between the 'parent' and the 'child', this suggests that you don't need to split your data across 2 tables. I may well have got the wrong end of the stick here, but some extra details about the problem would be useful.
ASKER
"Firstly, if the main form is unbound, how can it have a parent/child relationship with the subform?"
Through text box controls that change as the underlying recordset changes.
"And secondly, if there's an exact 1-to-1 correspondence between the 'parent' and the 'child', this suggests that you don't need to split your data across 2 tables."
Yes, I struggled with that. However, it's a case where if you edit one type of record it will be a one to one relationship. On the other hand, you can edit the related table directly.
Here's what happens, a package leaves a facility enroute to a satelite office. That package becomes the responsibility fo the satellite office. Now that package can still move from customer to customer even though the package remains the property of the satellite office.
Upon initial shipment from the main office, the date of shipment and the first assignment to a satellite office and a customer are all the same date. Of course, once the package begins moving from customer to customer the dates will change unrelated to the initial ship date.
I'm trying to get rid ofsome of the grunt work on keeping the dates the same but I may have to wind up coding it.
Through text box controls that change as the underlying recordset changes.
"And secondly, if there's an exact 1-to-1 correspondence between the 'parent' and the 'child', this suggests that you don't need to split your data across 2 tables."
Yes, I struggled with that. However, it's a case where if you edit one type of record it will be a one to one relationship. On the other hand, you can edit the related table directly.
Here's what happens, a package leaves a facility enroute to a satelite office. That package becomes the responsibility fo the satellite office. Now that package can still move from customer to customer even though the package remains the property of the satellite office.
Upon initial shipment from the main office, the date of shipment and the first assignment to a satellite office and a customer are all the same date. Of course, once the package begins moving from customer to customer the dates will change unrelated to the initial ship date.
I'm trying to get rid ofsome of the grunt work on keeping the dates the same but I may have to wind up coding it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, that's much better. Thanks