Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Location
    UK
    Posts
    122

    Unanswered: Access fails to run an on load event on load untill user clicks - why?

    Access fails to run an on load event on load untill user clicks - why?

    here is the onload code, as you can see the first thing that should happen is that the message box should pop up and say "Hi There" but nothing happens untill I click somewhere. Why should that be?

    Code:
    Private Sub Form_Load()
    On Error GoTo MsgError
    Dim intx As Integer
    Dim intCount As Integer
    'DoEvents
    MsgBox "hi there"
            intCount = Forms.Count - 1
            For intx = intCount To 0 Step -1
                 If Forms(intx).Name <> Me.Name And Forms(intx).Name <> "HiddenStarter" Then
                     DoCmd.Close acForm, Forms(intx).Name
                 End If
            Next
        DoCmd.Maximize
        'SetUpLimits
        TestID
        CurrentF = "PCE"
        'DoEvents
        'DoCmd.SetWarnings False
        'DoCmd.SetWarnings True
        [Side Bar].SetFocus
        [Side Bar].Requery
    GoTo SkipThis
    MsgError:
    MsgBox "ERROR! No #" & Err.Number & " - MSG: " & Err.Description
    Resume Next
    SkipThis:
    End Sub
    Matt the Hat says: "what!?"
    A child of five could understand this! Fetch me a child of five!
    SCARY HARD CHALLENGE: http://www.dbforums.com/showthread.php?threadid=988682

  2. #2
    Join Date
    Jun 2003
    Location
    UK
    Posts
    68
    The only thing I can think of is that the form does not have the focus. I rember having something similar in an Access 2000 database I was managing.

    Paul

  3. #3
    Join Date
    Sep 2003
    Location
    UK
    Posts
    122
    How odd... you might have a point... must give focus to parent... hmm

    the question is how
    Matt the Hat says: "what!?"
    A child of five could understand this! Fetch me a child of five!
    SCARY HARD CHALLENGE: http://www.dbforums.com/showthread.php?threadid=988682

  4. #4
    Join Date
    Sep 2003
    Location
    UK
    Posts
    122
    the tab control seems to be stealing focus... but it has no focus events...
    Matt the Hat says: "what!?"
    A child of five could understand this! Fetch me a child of five!
    SCARY HARD CHALLENGE: http://www.dbforums.com/showthread.php?threadid=988682

Posting Permissions

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