Solved

Access 2000 : Cannot see selected form records (seltop, selheight)

Posted on 2003-12-01
7
1,139 Views
Last Modified: 2007-12-19
I want a form button to process the (more than one) rows selected by the mouse on the record selector at left of form.
However when the button shows me the following (on button Click event):

    MsgBox "form.selheight=" & Me.SelHeight & "  form.seltop=" & Me.SelTop

the SelHeight is reported as zero (as if the selection has lost the focus has been taken from the multple selection) even though I selected 2 or more records.

The same happens when
1/ button Enter event (ie before it has focus) is used
2/ the button is in a subform referencing Me.Parent.sel___ )

Any ideas how my code can "see" the selection ?
0
Comment
Question by:starrynighter
7 Comments
 
LVL 32

Expert Comment

by:jadedata
Comment Utility
Hey starrynighter!

  Have you consider using a Extended Multiselect Listbox for this purpose instead.
  The listbox has a ItemsSelect collection that can be used to accomplish this multi-select processing.

regards
Jack
0
 

Author Comment

by:starrynighter
Comment Utility
Yes- and I may do, but the appeal of the record selection that I am trying to do is that the data being viewed can be quite long and multi-line per attribute (although I could remove the linefeeds to present it in a list box).
0
 
LVL 32

Expert Comment

by:jadedata
Comment Utility
On a form the records MUST be selected in a contiguous list.
Your problem is with the change in focus.  Once focus is lost from the subform the .seltop/selheight properties get murky.

With the list box you wouldn't have this issue.

If you only want one line to appear then only select the first 50-60 chrs of the value as the listbox visible value.

A multi-line value is not usually optimal for multiple selection actions.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Accepted Solution

by:
starrynighter earned 0 total points
Comment Utility
Thanks Jack- I appreciate your points but I have good reasons for wanting to do it this way.

I found the solution at
http://support.microsoft.com/?kbid=208502

The essence of the solution provided is that the .seltop/.selheight values are captured via a "mouse move" event on the button in question BEFORE it gets focus (ie while the selected records are still selected)
0
 
LVL 9

Expert Comment

by:ornicar
Comment Utility
----------------------------------------------------------------------------------------
This question has been abandoned and needs to be finalized.
 You can accept an answer, split the points, or get a refund (information at http:/help.jsp#hs5)
  If you need a moderator to help you, post a question at Community Support (http:/Community_Support/)

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

ornicar
Cleanup Volunteer

---------------------------------------------------------------------------------------------
0
 
LVL 39

Expert Comment

by:stevbe
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ with points refunded

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

stevbe
EE Cleanup Volunteer
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now