Solved

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

Posted on 2003-12-01
7
1,229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 32

Expert Comment

by:jadedata
ID: 9852723
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
ID: 9854715
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
ID: 9855854
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Accepted Solution

by:
starrynighter earned 0 total points
ID: 9855942
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
ID: 10075547
----------------------------------------------------------------------------------------
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
ID: 10210333
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
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.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

628 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