Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Miles R is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    280
    OK, I gave your code a run - took the risk and as you say, there was no gap. Puzzling.
    Mine application still shows a gap. I have had a look at all Form attributes on both and there does not seem to be anything that could cause a discrepancy.

    I have attached a screen shot showing the gap.Click image for larger version. 

Name:	Two Forms.JPG 
Views:	7 
Size:	22.3 KB 
ID:	45275

    The code is these forms is simple :-
    Form 1
    Private Sub Form_Load()
    ' Left, Top, Width, Height
    Me.Move 3000, 0, , 2500
    End Sub
    Form 2
    Private Sub Form_Load()
    ' Left, Top, Width, Height
    Me.Move 3000, [Form_F1].WindowTop + [Form_F1].WindowHeight, , 3000
    End Sub


    You will also notice that Form 2 is slightly to the left of Form 1. This is because I made Form 1 with Border Dialog and Form 2 with Border None

    I am sure I will get to the bottom of this somehow, but can't figure it out yet.
    As I say, I have a workaround, so don't waste your time on this.
    It is very strange.

  2. #17
    Miles R is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    280
    Colin,

    OK may have figured it out. Your forms are set to Popup = No, Mine are set to Popup = Yes
    If I change FormA in your application to Popup, the gap appears. Don't have any good reason as to why this should be the case though.

    Not quite sure why I chose mine to be Popup, will have to look again at this.

    Regards,

    Miles

  3. #18
    Miles R is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    280
    OK,

    Now remember. My main form is Maximized using Docmd.Maximize, so I have to have the other forms as Popup otherwise they will also be maximized.
    It seems that I will have to live with the slight discrepancy between visible popup form height and WindowHeight unless I set the Border style to None.

  4. #19
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Popup forms appear independently of the Access application window and their placement is handled in a different way.
    Using my example app, try what happens if you set BOTH forms to be popup.

    I think the reason why your forms have to be popup to prevent them being maximised is because you are using tabbed documents display which is the Access default.
    However that is something I never use.
    Try changing the display to overlapping windows in Access options and change all forms to popup= No.
    Your problems will be solved. The forms won't be maximised and will be placed exactly where your code intends them to go.
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  5. #20
    Miles R is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    280
    Thanks for the reply.
    I tried changing both to Popup and the second form is no longer aligned with the first.

    My application is actually set to Overlapping Windows. It has many forms, some Maximized (the non-popup ones), some Popup and some Modal depending on their purpose.
    It works pretty well and have got a workaround for the minor issue.

    Thanks again for the input.

  6. #21
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Quote Originally Posted by Miles R View Post
    Thanks for the reply.
    I tried changing both to Popup and the second form is no longer aligned with the first.

    My application is actually set to Overlapping Windows. It has many forms, some Maximized (the non-popup ones), some Popup and some Modal depending on their purpose.
    It works pretty well and have got a workaround for the minor issue.

    Thanks again for the input.
    1. That was indeed the point of suggesting you try both forms as popups. Their position is independent of the app window and, indeed, of each other.
    2. Ah yes. Sorry I misread an earlier reply.
    However when using overlapping windows, just because the main form is maximised, the other forms don't need to be popups to prevent them being maximised as well.
    Just add the line DoCmd.Restore to the Form_Load event of the subsequent form(s) and remove the popup status.

    Hope that helps
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  7. #22
    Miles R is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    280
    Colin,

    Yes thanks for your help with this.

    Best regards,

    Miles

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. vb to close command window
    By TSSIn in forum Programming
    Replies: 1
    Last Post: 07-22-2020, 06:30 PM
  2. Replies: 2
    Last Post: 02-28-2018, 05:04 PM
  3. Move a command button?
    By 82280zx in forum Forms
    Replies: 2
    Last Post: 06-16-2014, 04:40 PM
  4. Move to next field command...
    By mvolpone in forum Forms
    Replies: 1
    Last Post: 07-06-2010, 09:30 PM
  5. Use fixed height and width for the Access window
    By AndrewAfresh in forum Access
    Replies: 3
    Last Post: 07-05-2006, 09:20 AM

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