Results 1 to 4 of 4

Thread: Userform startup position
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Feb 2008
    Location
    Glendale, Arizona USA
    Posts
    457
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Userform startup position

    Greetings, I am using the following code to open a number of userforms simultaneously in a cascade layout. The first code (cleanroom zone) runs perfectly and the userforms layout just as I want them to. But the second one (grayroom zone) doesn't. The userforms do not start up in the same place, in fact a couple of them are stacked directly on each other. I can't figure out why, the code is exactly the same on each one. Anyone have an idea why they are not launching the same? Thanks,


    Code:
    Private Sub CleanroomZoneButton_Click()
    
        Unload EmergencyLightArea
    
        With DataEntryEmergencyShowerCr
        .Top = 10
        .Left = 10
        End With
        DataEntryEmergencyShowerCr.Show
            
        With DataEntryFeCr
        .Top = 50
        .Left = 50
        End With
        DataEntryFeCr.Show
            
        With DataEntryElCr
        .Top = 100
        .Left = 100
        End With
        DataEntryElCr.Show
            
        With DataEntryLadder
        .Top = 150
        .Left = 150
        End With
        DataEntryLadder.Show
            
        
    End Sub
    Code:
    Private Sub GrayroomZoneButton_Click()
    
        Unload EmergencyLightArea
        
        With DataEntryEmergencyShowerGr
        .Top = 10
        .Left = 10
        End With
        DataEntryEmergencyShowerGr.Show
            
        With DataEntryFeGr
        .Top = 50
        .Left = 50
        End With
        DataEntryFeGr.Show
            
        With DataEntryElGr
        .Top = 100
        .Left = 100
        End With
        DataEntryElGr.Show
            
        With DataEntryLadder
        .Top = 150
        .Left = 150
        End With
        DataEntryLadder.Show
        
    
    End Sub

  2. #2
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    6,254
    Post Thanks / Like
    Mentioned
    71 Post(s)
    Tagged
    14 Thread(s)

    Default Re: Userform startup position

    Try this

    Code:
    Private Sub CleanroomZoneButton_Click()
    
    
        Unload EmergencyLightArea
    
    
        DataEntryEmergencyShowerCr.Show
        With DataEntryEmergencyShowerCr
        .Top = 10
        .Left = 10
        End With
        DoEvents
            
        DataEntryFeCr.Show
        With DataEntryFeCr
        .Top = 50
        .Left = 50
        End With
        DoEvents
            
        DataEntryElCr.Show
        With DataEntryElCr
        .Top = 100
        .Left = 100
        End With
        DoEvents
    
    
        DataEntryLadder.Show
        With DataEntryLadder
        .Top = 150
        .Left = 150
        End With
        DoEvents
    End Sub
    
    
    Private Sub GrayroomZoneButton_Click()
    
    
        Unload EmergencyLightArea
        
        DataEntryEmergencyShowerGr.Show
        With DataEntryEmergencyShowerGr
        .Top = 10
        .Left = 10
        End With
        DoEvents
            
        DataEntryFeGr.Show
        With DataEntryFeGr
        .Top = 50
        .Left = 50
        End With
        DoEvents
        
        DataEntryElGr.Show
        With DataEntryElGr
        .Top = 100
        .Left = 100
        End With
        DoEvents
            
        DataEntryLadder.Show
        With DataEntryLadder
        .Top = 150
        .Left = 150
        End With
        DoEvents
    End Sub
    Regards Dante Amor

  3. #3
    Board Regular
    Join Date
    Feb 2008
    Location
    Glendale, Arizona USA
    Posts
    457
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Userform startup position

    Thanks for the reply Dante, I realized later that I had made a rookie mistake and that the startup settings on some of my userforms was set to "1-center" instead of "0-manual". Duh, I appreciate the help

  4. #4
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    6,254
    Post Thanks / Like
    Mentioned
    71 Post(s)
    Tagged
    14 Thread(s)

    Default Re: Userform startup position

    I'm glad to help you. Thanks for the feedback.
    Regards Dante Amor

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •