Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popup Position 2

Status
Not open for further replies.

Domino2

Technical User
Jun 8, 2008
475
GB
I did a forum search, tried an example and my popup dissapeared. I tried changing to moveto position but still could not find it. I have 3 questions.

1. How can I set the position and size of a popup form having no border (trying to integrate it on a form)

2. Is there a way to keep it visible when clicking other controls (without a lot of flickering appearances) I cannot make it a modal, as the popup contains a listbox and controls and needs to be visible at all times but allow users to go anywhere on the mainform without it closing.

3) Can a popup be externally closed?, ie not a command button in the popup forms footer

Any suggestions, thanks
 
Why not load the form into a subform? You can close any form with DoCmd.Close.
 
Thanks Remou. I am trying to resolve a problem with a listbox that repaints or refreshes when its disabled in code, it also repaints or refreshes when you select an item from it (this does not happen if you rem out the Bookmark part of code)

I have searched and searched the internet and found two other people with the problem, but with no fix. I found that if you select an item in the listbox, and then click on something else on the form, the lists onclick gets fired again. People have told me its a bug in 2003 with listboxes. I tried putting the list in a subform, and it still refreshed, however if I put the listbox in a popup form the list is perfect, no more flickering, just as it should be. So after weeks of lost time I am staying on the road of using a popup, its just how I overcome tying it down, thats if its possible. Thanks
 
What a nuisance!

You can use DoCmd.Movesize to position the form. Setting the pop-up property to Yes should keep it on top of the other form.
 
Thanks Remou, yes I've been to hell and back with it. Regarding the popup, if I click on another control, the popup hides underneath my mainform/subform. Also, code for opening it from a button is easy, but I have not found any code for closing it from an unbound button. Maybe you can't? Regards
 
Have you set the Pop-up property (beside the modal property) of the pop-up form to Yes and the modal and pop-up properties of the main form to No?

To close any form, you can use this code:

DoCmd.Close acForm, "NameOfFormToClose"

It will work nearly everywhere.
 
My mainform is set as a popup!!, as I want it to open over the Access application form and menu's, so thats probably why the popup takes its unwanted ordering. In addition, my taskbar is held open, as users want to see other prompts. Probably if I remove the popup feature, my Access mainform might close if they click a taskbar option. Not easy is it.
 
This is not going to work. You cannot have the main form pop-up if you wish the pop-up form to open over it. You will have to consider another work-around. Would it be possible to use a menu rather than a pop-up form? Would it be possible to use a smaller main form so that the pop-up could open to one side? Would a treeview on the main form work for you?
 
Thanks, thought that might be the case. I think you have an idea there. I have a mainform, a subform, and the popup. The popup is only wanted with the subform. At the moment my mainform stays open, the subform opens on top. What I might try is setting the width and height of my mainform to zero when showing the subform, and reduce the height and top position on my subform so the popup can be above. Whether that works I will have to try. I need to read about Movesize and I might get there at last. Thanks again.
 
Have you tried changing your subform on the fly? Put a button on your subform that opens your "popup form". Then you won't have to do worry about the size or moving/hiding.

Put this code in the onclick event of your button properties:

Forms!nameofmainform!nameofsubform.sourceobject = "nameofpopupform"

Then put a button on your pop up form when for when you want to close it to do this in your onclick event

Forms!nameofmainform!nameofpopupform.sourceobject = "nameofsubform"

 
Thanks, I will try it all. If I reduce the sixe of my subform it will show the top section of my subform until the popup is open, Thats not a problem as I can open the popup at the time of opening the subform. Only bit I have not tried out is closing the subform and the popup when the user returns to the mainform. Will give it all a try later.
 
Cool. Good luck. Now let me correct my second line

Forms!nameofmainform!nameofsubformcontrol.sourceobject = "formname
 
So far, so good. Now I am trying to position the borderless popup.

Is this syntax correct, as it appears momentarily, then dissapears?

Forms(stDocName).Move Left:=0, Top:=0, Width:=400, Height:=300

I tried increasing the values but no change. Thanks
 
Skip the width and height, 300 and 400 is a very small size in twips. Try:

Forms(stDocName).Move Left:=100, Top:=100


 
Gave it a shot but it still appears for a split second in its unwanted position then vanishes. I tried increasing the top to 5000. I closed down forms expecting it to be underneath something but it was not there. I also tried a second command line after the moving statement for it to open and nothing appears.
 
Sorry, I was not paying attention. You want:

DoCmd.MoveSize 100,100

The open event should suit, I think.
 
Hooooray!. Many thanks Remou, that fixed that problem.
 
Spoke too soon, still struggling. Scenario is:

Mainform opens - Set as popup.
Record selected - Subform opens - Set as popup, but its size and position is over bottom half of the mainform. Also popup loaded to appear over top half of mainform. However if I click on the subform below, my popup at the top vanishes. I thought if the subform and the popup did not touch each other the popup would hang in there but not so lucky. Any last ditch ideas, thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top