Solved

ListBox on top of Subform

Posted on 2000-04-17
18
327 Views
Last Modified: 2012-05-04
I have a temporary listbox which is displayed over a subform. However because the subform is "always on top" I can't click to make a selection.
In the help-file I read that both subforms and listboxes are "always on top".

Is there any way to get the listbox tohave a higher priority??? I could also use a pop-up for my listbox, but this is not an elegant solution in my opinion.

 
0
Comment
Question by:GOLLEM
[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
  • 9
  • 4
  • 2
  • +3
18 Comments
 
LVL 6

Expert Comment

by:simonbennett
ID: 2722076
Is you subform Modal? If so, turn it off.

HTH

Simon
0
 
LVL 10

Expert Comment

by:paasky
ID: 2722083
Hello GOLLEM,

You could hide (Me.Subform1.Visible = False) the subform when you want user to see listbox...

Regards,
Paasky
0
 

Expert Comment

by:toesable
ID: 2722101
One way is to create the list box after you have created the subform.  i.e. place the subform then place the listbox when designing it.  The list box when not visible doesn't seem to mess with the use of the subform but you can still use the list box when it is visible.  Or, anyway, that's what happened in my test.  It seems that Access is getting it's priority from creation of the component.

Good Luck  
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:GOLLEM
ID: 2722136
simon->

Subform is not modal...

paasky->

I'd rather use the pop-up solution then, the subform is almost as big as the screen.
Looks a bit messy if your users see most of their screen disappear, along with everything they just filled in..
Next thing you know they're in panic *LOL*

toesable->

I created my listbox after my subform.
I'll try to achieve the same thing on another form, maybe I'll get lucky....

Another thought.....

Maybe it has to do with what control gets painted first (access paints a screen top-down) I'll check on that.

Regards,

        Michiel
0
 

Author Comment

by:GOLLEM
ID: 2722182
toesable->

tried it 20 times already and your solution doesn't work here....

Is there something I'm not seeing here??? Maybe you have one of MS-Acesses global variables set differently?? Or is there a patch I missed??

0
 

Expert Comment

by:toesable
ID: 2722198
Weird. My test works perfectly.  Must have something set differently.  Just a shot in the dark here, have you tried setting the enabled property of the subform to false while working on the listbox or do you need them simultaneously active?
0
 

Expert Comment

by:toesable
ID: 2722201
Oh, hey, are you on 97 or 2000?
0
 

Author Comment

by:GOLLEM
ID: 2722229
toesable->

enabled doesn't work...

I'm on '97. If you're on 2000, then this could be the first thing I've seen that's actually better in 2000.... :)

0
 

Author Comment

by:GOLLEM
ID: 2722235
tried locking the subform also, doesn't work either
0
 
LVL 54

Expert Comment

by:nico5038
ID: 2722253
In 97 got a listbox partially "on top" of the subform, however.....

When clicking on the part that's over the subform, this is getting the focus !

Think you will have to use a different solution anyway !
(No space left on the mainform for a combo ?)

Nico
0
 

Expert Comment

by:toesable
ID: 2722255
I agree with that.  2000 took two steps backwards, but that's what I'm on.  I'll let someone who's on 97 give it a try for you.  Take care  toe
0
 

Author Comment

by:GOLLEM
ID: 2722291
nico->

I'm using a listbox, because it looks better :)

I have about 1.25 cm left for the listbox, so that's about three entries. I want to display quite a long list in there, so I need more room.

O.k. since this doesn't seem to be possible in Access '97, I'm going to change the question:

I want to use a pop-up form for the listbox. How do I specify where to put the pop-up form relative to the main form??

(maybe through API, but how do I get the correct values and which API-calls do I have to use??)

 
0
 
LVL 6

Accepted Solution

by:
simonbennett earned 15 total points
ID: 2722508
GOLLEM

Not sure but can you set the zorder in access like VB? If not try this API

in general declarations

Public Const HWND_TOPMOST = -1Public Const HWND_NOTOPMOST = -2
Public Const SWP_NOMOVE = &H2Public Const SWP_NOSIZE = &H1
Public Const SWP_NOACTIVATE = &H10Public Const SWP_SHOWWINDOW = &H40
Public Const TOPMOST_FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Public Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" _
    (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, _
     ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

.... and then this function....

Dim r As Longr = SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS)

HTH

Simon


0
 

Author Comment

by:GOLLEM
ID: 2722539
O.k. I found a different solution. I now use a second subform for my listbox. This does work and best of all you can't tell the difference... :)

0
 
LVL 3

Expert Comment

by:jerelw
ID: 2729236
right click and select "top"
0
 

Author Comment

by:GOLLEM
ID: 2729808
Suppose you're talking about MS Access 2000 again???

I tried right clicking both in design view and in form view, both didn't produce the menuchoice you described....


I would prefer (as do most experts here) that you not answer a question but leave a comment so I can decide for myself who gets points...

Regards,

        Michiel
0
 

Author Comment

by:GOLLEM
ID: 2746764
Simon->

I was looking at your comment and got interrested...

I'm quite new at API, so could you please explain what the function does exactly?

My guess is that it sets the window that currently has the focus to the values specified.
The part 'ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long' would be left, top, width and height of the window in twips right???


What does the long that it returns stand for???

Is there also a function that returns the left, top width and height of the current window? (this woukd help if I ever would want to set the values for a window based upon another window.

Think I'll buy a book on API in the near future, can you recommend one?

Regards,

         Michiel


P.S. answer these questions and the points are yours of course :)
0
 

Author Comment

by:GOLLEM
ID: 2772674
I don't want to keep this thread open indefinitely, so I'm awarding the points to Simon.

regards,

         Michiel
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
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…
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, 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…

730 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