[AccessD] Select Multiple records on form

Ken Ismert KIsmert at TexasSystems.com
Mon May 15 11:41:23 CDT 2006


 
Mark,

>> I just need to select more than one(non-sequential), have them stay
selected...

Well, neither A.D.'s or my solution will work with discontinuous
selections. Access forms simply don't natively support that. 

If your recordset is non-updatable, and you have to have discontinuous
selections, you really have two choices:

* Write the recordset to a temporary table. Include a yes/no field in
the table for the user to select. Set the form to the table. The user
selects a record by checking the box. You can easily set conditional
formatting keying off of that field. 

If you choose to go the conditional formatting route, you can simplify
highlighting rows by making the backgrounds of all the controls
transparent. Insert a single large textbox the size of the row, and set
its ControlSource to the yes/no field. Set its foreground and background
colors to gray. Set conditional formatting to show your highlight color
(foreground and background) when the user checks the checkbox. Send the
background control to back, and put it behind your record controls. That
way you can highlight the whole record with just one control. 

* If the list of things is under several hundred, you can use a select
list dialog, the kind that shows a list of choices on the left window,
and lets you click arrow buttons to move your selections to the window
on the right. 

I have a Select List userform dialog that can read DAO or ADO
recordsets, and let the user choose, if you like. 

-Ken




More information about the AccessD mailing list