Select records via checkbox

J

John J.

In a continuous subform I simply want to add a check box to every record, so
that the user can select records. Google gave me some results that advised
to add the check box to the table. But since this is a multi user app I
can't take the risk of people wanting to check the same record. What's best
practice in this situation?
Thank you.
John
 
J

John J.

It is set up the way you describe. The subform contains a hyperlink field.
By checking the subform's records the user choses which files he wants to
add to the automated email. When the user moves to another record, the
selection should be lost. If 2 users want do this selection for the same
main form's record at the same time their selection will interfere with
eachother. Also if a user won't leave the record, the other user won't be
able to make a selection. Or am I missing something here?
John
 
A

AG

John,

So, the only use for the checkbox is to select which records you include in
the email?
One solution is to create a local tempory table containing two fields. The
primary key field of your linked table and the checkbox field.
Before opening the form, populate the temp table with the values of the
linked table's PK field.
Change the recordsource of your form to be a join (on PK field) of your
linked table and the temp table.
That way anyone can check or uncheck a record without affecting anyone else.
If your form allows additions, don't forget to insert a new record in the
temp table whenever you add a new record.
 
J

John J.

Thanks! That sounds good. But how can I make sure a new record in the temp
table is created whenever a user adds a new hyperlink record? I noticed I
really need to do so, otherwise the checkboxes are grey.

Still, I think it's a bit strange that there isn't a vba solution for this
functionality. This seems so convulated and populating a temp table will
cause the frontend to grow.
John
 
A

AG

John,

There can't be a canned solution for everything.
In the after insert event of your form, just run code to insert the record
into the temp table with the new PK.
I generally use a temp database with all linked temp tables that is
recreated every time the app is opened. That prevents the front end from
growing.
 
Top