Results 1 to 4 of 4
  1. #1
    Abacus1234 is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    212

    OnOpen Event Procedure causing intermittent error message

    I have the following Event Procedure in the On Open Property of a form

    Private Sub Form_Open(Cancel As Integer)
    Select Case Forms!FEditHud!cdmarker
    Case "cd"
    Me.Command1840.Visible = True
    Me.Label1850.Visible = True
    Me.Command1842.Visible = True
    Me.Command1852.Visible = True
    Me.GotoPage2.Visible = False
    Me.Command1839.Visible = True
    Me.Command1841.Visible = True
    Me.Command21.Visible = False
    Me.Command1507.Visible = False
    Me.Command1853.Visible = True
    Me.Command1857.Visible = True
    Me.Command1858.Visible = True
    Me.L701c.SetFocus


    Me.L702c.SetFocus
    Case "ss"
    Case Else
    MsgBox "check that cdmarker field has cd or ss"
    End Select

    End Sub

    and occasionally, see this message when I open the form

    "This error occurs when an event has failed to run because Microsoft Office Access cannot evaluate the location of the logic for the event.
    For example, If the OnOpen Property of a form is set to =[field], the error occurs because Access expects a macro or event name to run when the event is fired.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    put the code in FORM LOAD, (not open)

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Or the form OnCurrent event.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Abacus1234 is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    212
    Thanks for the suggestions.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 12-22-2014, 11:57 AM
  2. AllowDeletion Property on OnOpen event
    By excellenthelp in forum Access
    Replies: 2
    Last Post: 11-18-2014, 08:31 AM
  3. Replies: 2
    Last Post: 02-14-2014, 04:05 PM
  4. Replies: 2
    Last Post: 01-22-2013, 10:39 PM
  5. Display Procedure in Message Box on Error
    By gopherking in forum Programming
    Replies: 1
    Last Post: 01-20-2012, 08:15 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