+ Reply to Thread
Results 1 to 3 of 3

Loading a Userform

  1. #1
    Jason Zischke
    Guest

    Loading a Userform

    Hi All,

    I have a form that shows for about 5 seconds then unloads however when it
    shows up the form is just white is there a way for it to show the info on it
    my code is below,can someone help me?

    Jason

    Sub ShowForm()
    Userform1.Show
    End Sub

    Dim MyTime
    Private Sub UserForm_Activate()
    MyTime = Time
    x = MyTime
    y = 0
    MyNum = TimeValue("00:00:05")
    Do Until y = 1
    Z = x + MyNum
    If x + MyNum <= MyTime Then
    y = 1
    End If
    MyTime = Time
    Loop
    If y = 1 Then
    UserForm1.Hide
    End If
    End Sub

  2. #2
    Nigel
    Guest

    Re: Loading a Userform

    Try putting your delay code into the userform initialize event instead. You
    also hide the form, this does not unload it. Note: you could more simply use
    OnTime to initiate the delay e.g.

    ' in the user form code put this.....

    Private Sub UserForm_Initialize()
    Application.OnTime Now + TimeValue("00:00:05"), "fm_UnLoad"
    End Sub


    ' in a standard module use these to load / unload the form

    Sub fm_load()
    UserForm1.Show
    End Sub

    Sub fm_UnLoad()
    Unload UserForm1
    End Sub

    --
    Cheers
    Nigel



    "Jason Zischke" <[email protected]> wrote in message
    news:[email protected]...
    > Hi All,
    >
    > I have a form that shows for about 5 seconds then unloads however when it
    > shows up the form is just white is there a way for it to show the info on

    it
    > my code is below,can someone help me?
    >
    > Jason
    >
    > Sub ShowForm()
    > Userform1.Show
    > End Sub
    >
    > Dim MyTime
    > Private Sub UserForm_Activate()
    > MyTime = Time
    > x = MyTime
    > y = 0
    > MyNum = TimeValue("00:00:05")
    > Do Until y = 1
    > Z = x + MyNum
    > If x + MyNum <= MyTime Then
    > y = 1
    > End If
    > MyTime = Time
    > Loop
    > If y = 1 Then
    > UserForm1.Hide
    > End If
    > End Sub




  3. #3
    Bob Phillips
    Guest

    Re: Loading a Userform

    Try this

    Private Sub UserForm_Activate()
    MyTime = Time
    x = MyTime
    y = 0
    MyNum = TimeValue("00:00:05")
    Me.Repaint
    Do Until y = 1
    Z = x + MyNum
    If x + MyNum <= MyTime Then
    y = 1
    End If
    MyTime = Time
    Loop
    If y = 1 Then
    UserForm1.Hide
    End If
    End Sub



    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Jason Zischke" <[email protected]> wrote in message
    news:[email protected]...
    > Hi All,
    >
    > I have a form that shows for about 5 seconds then unloads however when it
    > shows up the form is just white is there a way for it to show the info on

    it
    > my code is below,can someone help me?
    >
    > Jason
    >
    > Sub ShowForm()
    > Userform1.Show
    > End Sub
    >
    > Dim MyTime
    > Private Sub UserForm_Activate()
    > MyTime = Time
    > x = MyTime
    > y = 0
    > MyNum = TimeValue("00:00:05")
    > Do Until y = 1
    > Z = x + MyNum
    > If x + MyNum <= MyTime Then
    > y = 1
    > End If
    > MyTime = Time
    > Loop
    > If y = 1 Then
    > UserForm1.Hide
    > End If
    > End Sub




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1