Solved

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

Posted on 2003-12-01
7
1,154 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
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Two list boxes - best structure 3 32
Restrict list data depending upon user name 3 21
Query design issue 2 24
MS Access VBA Print PDF just Current Page 9 12
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
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.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

896 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

16 Experts available now in Live!

Get 1:1 Help Now