Detect LostFocus of PopUp Form

Just an idea that I haven't tried out:
Use the pop-up only to the display the comboboxes. As soon as the user selects a control, you set the focus to a combo box behind the text field - but in the continuous form. This gives you control over the focus change again.

/edit (#22)
@ Colin: fixed ;)
 
Last edited:
Use the pop-up only to the display the comboboxes. As soon as the user selects a control, you set the focus to a combo box behind the text field - but in the endless form. This gives you control over the focus change again.
I don't yet understand how this would work.
If I set the focus back to a combo on the continuous form, then that one combo box will be visible for all records, while it makes sense for the active record only. The result will be the messy and confusing UI I strive to avoid with the pop-up form overlay.
Am I missing something?
 
I tried it (code is dirty):

/edit: new version
PopupCombobox.gif
 

Attachments

Last edited:
Update:
I'm currently evaluating to subclass the pop-up form to create the missing (De)Activate event myself.
At first glance, this looks promising but it is pretty tedious to iron out the remaining kinks, as the VBA debugger is sabotaging the handling of the window messages.
 
From what I think the video clip was showing, I'm not sure whether the proposed layout will be easily understood by users
I think having a small popup form appear immediately below the record / field would be easier to understand
I did something similar in the forms 2 & 3 of the example app that accompanies my article:

In that case, the popup form was meant to be read only but the principle in terms of UI is much the same

BTW you may not have seen my first reply in post #20 as it was at the end of page 1
 
/edit: new version
Some quick thoughts...
@Josef P. , your demo is impressive. It works much better than I thought possible.
Still, I'm not sure if I want to pursue this approach further. In my delusion of grandeur I envision that my approach, even though it is massively more complex, lends itself more to being reusable for varying scenarios with less effort. Due to the pop-up form hosting the edit controls, it has much more flexibility in regard to the type and number of edit controls. If it works as envisioned (still to be proved), the edit form can be adapted to different scenarios without requiring (many) changes to the underlying continuous form.

@isladogs and @MajP, I noted your contributions, thank you! I will come back to your suggestions and comments once I got more conclusive findings and results with my current state of chaos work.
 
Exactly.
When the user clicks into the main form, I want to hide the pop-up.
I understand the visual problem you are trying to solve but the action is obscure and I would be confused if I encountered it. What are you doing with the selections the user makes in the popup when he moves focus back to the main form? How does the user communicate whether or not he wants to keep the change?

What is wrong with the combos always being visible? If this is a cascading combo issue, there are ways to resolve that for continuous forms if that will help you.
 
.. itself more to being reusable for varying scenarios with less effort.
In my example, the popup form can be an unbound combobox with empty RowSource property, as only the value to be displayed needs to be set.
The actual data selection takes place in the form that is there for this purpose - the continuous form with the data.

The advantage of this solution is that the pop-up never (permanently) receives the focus and it is therefore not necessary to monitor for a loss of focus.
I think this is scalable without any problems. I would add a control class in which you set the number of comboboxes and their dependencies so that it can handle the popup combos.

However, I don't know your planned solution, so I can't judge which is more “elegant”. ;)
 

Users who are viewing this thread

Back
Top Bottom