Hi,
On 23 Dec 2003 06:26:19 -0800, tom wrote:
[color=blue]
> Thanks for the reply. Yes, WHY would I want to do this is a good
> question... I have a situation where I want to have a popup form
> appear, much the same way a list pops down from a combo box or a
> context menu appears on right-click. I would then like to take some
> action when the user closes the popup form, and, as this could be one
> of many forms, I'm trying to move as much of the generalizable coding
> outside the form itself. SO, being able to sit and wait for the form
> to complete, as acDialog lets me, seems like a nice thing.
>
> HOWEVER, it sure would be better if this could behave like a regular
> popup and if the user clicks outside the popup it just goes away. How
> does one implement that (popup forms don't seem to fire activate and
> deactivate events)?[/color]
why don't you simply set the form's borderstyle (along with all other
related props) to "none", the dialog-prop to True and modal-prop to True?
This way you could simply state a [docmd.openform formname:="yourForm"] to
open the form that way. The arguments required by the form being called
could be passed using OpenArgs (i.e. seperated by semicolons, then
retrieved via Split()).
A somewhat different approach would be to create a function in a general
module or class, passing all args to that function (or properties, if a
class is being used) and the popup-form pulling these from the module's
properties. That would give you a more generally related way of retrieving
values from the popup as only the module/class and the form would
communicate with each other.
If you require positioning the form below a certain spot on the calling
form (i.e. the calling control's position) you'll have to make use of a
couple of APIs (see the "mouse-pos relative to Access-window"-sample on my
website) as, in order to calculate the control's position, you'll have to
retrieve information about the form's borderwidth, titlebar-height, etc..
But ... to me that'd only make sense if there's a single control as there
would be if you'd i.e. create your own combo-box. In that case I'd prefer
creating a user-control with VB6 and use that.
[color=blue]
> * I have a form with a listview control (populated based on a
> collection of objects, not a db table).
> * When the user clicks on an item in the list, the appropriate
> "handler" form pops up and lets them configure the item's underlying
> object.[/color]
And why does the handler-form have to called without a border? I guess most
users may be irritated as this clearly is a non-standard-situation ...
Cheers,
Olaf [MVP]
--
My .02:
www.Resources.IntuiDev.com