you will need a table something like this:
*AgencyStates*
AgStateID, autonumber
AgencyID, long integer -- FK to tblAgencies
StateID, long integer -- FK to tblStates
then, the RecordSource for your subform would be something like this:
SELECT
s.StateID
, s.Statename
, s.StateAbbreviation
, IIF(IsNull(AgS.AgStateID), false, true) as IsAssigned
FROM tblStates as s LEFT JOIN AgencyStates as AgS
ON s.StateID = AgS.StateID;
the form will not be able to be edited directly, but what you can do is
use the click event of the checkbox (whose ControlSource is IsAssigned)
in the code behind the subform:
if IsAssigned is not checked and becomes checked, use SQL to append a
record to the AgencyStates table
if IsAssigned is checked and becomes unchecked, use SQL to delete the
record from the AgencyStates table
then requery the (sub)form
Warm Regards,
Crystal
*
(: have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
> Here is my question:
>
[quoted text clipped - 31 lines]
>
> How do I do this? THANK YOU!