Form opens behind

NearImpossible

Registered User.
Local time
Today, 07:04
Joined
Jul 12, 2019
Messages
225
I have this same line of code on the double click event for 3 different fields on my form. 2 out of the 3 opens the form correctly when I double click on them, however when I double click on the last field, the form opens behind instead of in front.

The only difference between them is the 3rd is rich text where the other two are plain text. All 3 fields are enabled, but locked as this is a view only form.

Code:
    DoCmd.OpenForm "FacilityTicketDetails", , , "[TicketID] = " & Me.[TicketID], , , "SearchResults"

Any ideas?
 
setFocus() to the form, so it get to the Foreground.
 
setFocus() to the form, so it get to the Foreground.


same thing, it opens in front then jumps behind

Code:
Private Sub Issue_DblClick(Cancel As Integer)
    DoCmd.OpenForm "FacilityTicketDetails", , , "[TicketID] = " & Me.[TicketID], , , "SearchResults"
    Forms!FacilityTicketDetails.SetFocus
End Sub

funny thing is if I set it to run on the single click, it works just fine
 
If a form has enabled controls, you can't set focus to the form but you can set focus to an enabled control on the form.
No idea what is causing your issue though but I suppose you could try setting focus to a control but I doubt that will help. If focus can't be set to a form, focus goes to the last control that had the focus (assuming that is the case if it was already open). No idea what to expect if the form was not already open.

I might try opening a new form in design and copy/paste all of the controls from the old into the new and see if the form is corrupted. This all assumes you don't have code running after the form opens that minimizes it or something. I take it that it is actually open behind and not just minimized.
 

Users who are viewing this thread

Back
Top Bottom