Solved

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

Posted on 2003-12-01
7
1,198 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
Technology Partners: 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

751 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