Results 1 to 4 of 4
  1. #1
    TOPSie is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2021
    Posts
    153

    Forms behind???

    My Access (2016) application has several “Main” screens and many further “Information” screens.



    But consider this situation – Two Mains screens M1 and M2, two Information screens A & B. A has a SubForm embedded (Asub)

    From M1 I can open form B using acDialog
    Once on Form B I can click a control and open form A using acWindowNormal.
    Both A and B appear on the screen side by side and I can close either without affecting the other.

    However from M2 I open form A using acDialog and then using a control in Asub I try and open Form B using acWindowNormal then Form B is nowhere to be seen – it is actually there but behind M2 and only appears when I close both A and M2.

    I don’t understand why both A & B are visible in the first case but not the second. Is it to do with subforms or something else??

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Never have experienced. What I'd start with is ensuring all relevant form properties are the same, even borders. If that all looks OK then perhaps use code to control the position of both forms in both situations using MoveSize method. It might be due to one form having a subform as you say. One thing I can point out is that if you save a form while it's in a position, Access remembers that position next time you open it. Perhaps you did that and have inadvertently set its horizontal/vertical position to be somewhere you don't want. That doesn't apply to tabbed form views of course.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    TOPSie is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2021
    Posts
    153
    Quote Originally Posted by TOPSie View Post

    Is it to do with subforms ??
    No it is not to do with sub Forms. I move the "open other form" code to the main form of A with the same result.

    I also found some code using
    Code:
    Public Declare Function BringWindowToTop Lib "user32" _
    (ByVal hwnd As Long) As Long
    Which again had no effect as B is still behind the Main form


    I am not sure it is anything to do with the way the Form is saved (as in the other answer) as forms A and B are unchanged and if I go M to B to A it works, but the other way it doesn't - same forms just a different order.

    Ho hum

  4. #4
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Suggest you copy, compact/repair, zip and post here. See top forum menu for how to attach files if needed.
    I think this is going to be pretty difficult to solve otherwise. You can remove whatever is not needed for the issue and/or alter data as per here.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 04-05-2016, 08:29 AM
  2. Replies: 3
    Last Post: 03-23-2016, 12:45 PM
  3. Replies: 2
    Last Post: 11-05-2014, 09:16 AM
  4. Replies: 5
    Last Post: 01-16-2013, 03:48 PM
  5. Replies: 4
    Last Post: 04-01-2009, 08:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums