title: Setting the location of a form in access vba
body: <p>I'm working on an Access application with multiple nested forms on which the users clicks on selections in order to do specific tasks, e.g., enter new data, search for data, print a report, etc. </p>
  
  <p>Currently I have each form set with autocenter. I would like the user to be able to move the main form, then have all other forms open on top of the main form. The forms typically open as a dialog. </p>
  
  <p>I've just added the code to allow the subsequent forms to open in the same location as the main form. The main forms has code that looks like this:</p>
  
  <pre><code>Private Sub File_Maint_Click()
  Dim ObjName As String
  FrmWinTop = Forms![Main Form].WindowTop
  FrmWinLeft = Forms![Main Form].WindowLeft
  
  ObjName = "File Maintenance Form"
  If IsSuper Then DoCmd.OpenForm ObjName
  If Not IsSuper Then DoCmd.OpenForm ObjName, acNormal, , , , acDialog
  
  End Sub
  </code></pre>
  
  <p>Each subsequent form has code like this:</p>
  
  <pre><code>Private Sub Form_Open(Cancel As Integer)
  
      Me.Move FrmWinLeft, FrmWinTop
  
  End Sub
  </code></pre>
  
  <p>This works great, except - in normal operation I have the Access window minimized by code that opens the main form, and then the top and left of the main form is some obscure number, such that when the subsequent form opens it is not visible. If the Access window is visible, the code works correctly. </p>
  
  <p>Apparently my method won't work with the Access window minimized and only the dialog forms show, as far as I can tell. Is there a different way to hide the Access window when the application is running that would allow the forms to be located correctly? Or is there a different method of locating the forms on the screen such that each subsequent form will cover the previous form that opened it? </p>
  
  <p>Thanks much for reading my question, and providing any thoughts you may have.</p>