Which records are multi-selected in a continuous nonupdateable for

H

Holly

I have a continuous form subform that is bound to a nonupdateable recordset.
I cannot use a listbox for reasons that I won't bore you with. I need to
determine which records the user mulit-selects after the user clicks on a
command button. It appears that, after clicking on a command button, the
SelTop tells me which record is the first selected, but the SelHeight gets
reset to zero. I tried adding an unbound checkbox to the subform, but once
the user clicks any box, they all get selected. (this was on a previous
thread). Did I do something wrong? Any new ideas?
 
M

Marshall Barton

Holly said:
I have a continuous form subform that is bound to a nonupdateable recordset.
I cannot use a listbox for reasons that I won't bore you with. I need to
determine which records the user mulit-selects after the user clicks on a
command button. It appears that, after clicking on a command button, the
SelTop tells me which record is the first selected, but the SelHeight gets
reset to zero. I tried adding an unbound checkbox to the subform, but once
the user clicks any box, they all get selected. (this was on a previous
thread).


No, you haven't done any thing wrong. You just haven't
found a way that works.

Albert has an inovative way to deal with your situation in
his Multi Select Example at
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
 
S

Stephen Lebans

Create a module level Variable to hold the value of the SelHeight property.
In the Click event tof the FORM copy the SelHeight property to yuur
SelHeight variable.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
D

Dirk Goldgar

Holly said:
I have a continuous form subform that is bound to a nonupdateable
recordset. I cannot use a listbox for reasons that I won't bore you
with. I need to determine which records the user mulit-selects after
the user clicks on a command button. It appears that, after clicking
on a command button, the SelTop tells me which record is the first
selected, but the SelHeight gets reset to zero. I tried adding an
unbound checkbox to the subform, but once the user clicks any box,
they all get selected. (this was on a previous thread). Did I do
something wrong? Any new ideas?

If you only need to select a continuous range of records in the subform,
then you can snag the subform's SelTop and SelHeight properties in the
Exit event of the subform control. E.g.,

Private Sub Subform1_Exit(Cancel As Integer)

With Me.Subform1.Form
MsgBox .SelTop & ", " & .SelHeight
End With

End Sub

If you need to select non-contiguous records, though, you won't be able
to use SelTop and SelHeight.
 
H

Holly

Thank you all for your responses. I actually had the same thought as the last
post(using the exit event of the subform) after I posted my question, and it
worked. This must be an Access bug to require such a work-around!
 
D

Dirk Goldgar

Holly said:
Thank you all for your responses. I actually had the same thought as
the last post(using the exit event of the subform) after I posted my
question, and it worked. This must be an Access bug to require such a
work-around!

I'd say it falls into the category what Microsoft calls "by design",
meaning "you may not like it, but that's the way we intend it to work."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top