Improve company productivity with a Business Account.Sign Up

x
?
Solved

ListBox on top of Subform

Posted on 2000-04-17
18
Medium Priority
?
356 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
  • 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
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 

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 30 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

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

What to do if a split doesn't fit? Or a bunch of invoice lines must be rounded while the sum must match a total? It takes a little, but - when done - it is extremely easy to implement.
With the functions here, you can parse, convert, and format back and forth between feet and inches and fractions and decimal inches - for normal as well as extreme values and with extreme precision.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…

589 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