T
TC
The SelTop and SelHeight form properties tell you the range of records (if
any) that are currently selected using the recordselectors down the
left-hand side of the (sub)form. (Make sure the (sub)form has the
RecordSelectors property set to true, so the record selectors are
displayed.)
Ideally, you would then like a button that used those properties to set the
relevant checkboxes. Unfortunately, clicking a button moves the focus off
the recordselectors, so this can only be done (reliably) with some
surprisingly difficult coding.
So instead of using a button, reserve a keystroke for this purpose. To
"dummy it up" & see if it will work for you:
- set the (sub)form's KeyPreview property True;
- add a KyPress event for the (sub)form;
- in that event, say:
if keyascii = asc ("z") then msgbox me.selstart & ", " & me.sellength
Now run the (sub)form, click a recordselector, shift-click another one
further down (to extend the selection), then press "z" (without the quotes).
The msgbox should display the number of the first record selected, and the
number of records selected. That information is the basis on which you could
set the relevant checkboxes.
If you think that this approach would work for you:
- pick a better key than z"; perhaps Ctrl-something?
- recode the if-test accordingly;
- replace the msgbox with code that uses "bookmarks" and RecordSetClone to
set the relevant checkboxes;
- ask again here, if you can't get that last step to work.
HTH,
TC
any) that are currently selected using the recordselectors down the
left-hand side of the (sub)form. (Make sure the (sub)form has the
RecordSelectors property set to true, so the record selectors are
displayed.)
Ideally, you would then like a button that used those properties to set the
relevant checkboxes. Unfortunately, clicking a button moves the focus off
the recordselectors, so this can only be done (reliably) with some
surprisingly difficult coding.
So instead of using a button, reserve a keystroke for this purpose. To
"dummy it up" & see if it will work for you:
- set the (sub)form's KeyPreview property True;
- add a KyPress event for the (sub)form;
- in that event, say:
if keyascii = asc ("z") then msgbox me.selstart & ", " & me.sellength
Now run the (sub)form, click a recordselector, shift-click another one
further down (to extend the selection), then press "z" (without the quotes).
The msgbox should display the number of the first record selected, and the
number of records selected. That information is the basis on which you could
set the relevant checkboxes.
If you think that this approach would work for you:
- pick a better key than z"; perhaps Ctrl-something?
- recode the if-test accordingly;
- replace the msgbox with code that uses "bookmarks" and RecordSetClone to
set the relevant checkboxes;
- ask again here, if you can't get that last step to work.
HTH,
TC