var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Closing a form on Lost Focus
How do I get a form to close when it loosses focus, I have tried putting a close macro in both Lost focus and Deactiviate, but it returns "Action Failed"
You could try something like this:
Use the well known IsLoaded function within the Activate property of the Form that is actually gaining focus.
Private Sub Form_Activate()
If IsLoaded("TheFormThatMayBeLosingFocus") Then
DoCmd.Close acForm, "TheFormThatMayBeLosingFocus"
closing a form on lost focus
the event OnLostFocus should work. Are you sure something else isn't happening which is preventing this from working?
I will try that If statement, but I can't figure out why lost focus doesn't work, because it works for minimise just not for close.
Its probably something simple that I'm over looking
DoCmd.Close acForm, "name of form", acSaveNo
I used the above code in on Lost Focus, and I got, 'this action cant be carried out while processing a form or report'
I have no other active functions occurring, so I can't understand the conflict.
Seems like something is going in code or with the form. There shouldn't be anything which causes this error unless some action is being performed. But I may be wrong.