Results 1 to 4 of 4
  1. #1
    shuddle is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Dec 2016
    Posts
    43

    Query runs before On Open Event Procedure

    I have set an On Open Event Procedure to bring up a pop up building parameter form where a building number can be added. The main form has a query with [Form]![FM_Building_Parameter]![BldgCmb] in the criteria. The problem is the query is asking for the building number before the event runs to give me the chance to enter it.

    I have other forms that this works in and I'm not sure why it isn't working in this one.

    Any ideas?

    Private Sub Form_Open(Cancel As Integer)


    DoCmd.OpenForm "Fm_Building_Parameter", , , , , acDialog
    End Sub

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    It looking at the form that hasn't finished opening.
    put the openform code in FORM LOAD event.

  3. #3
    shuddle is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Dec 2016
    Posts
    43
    That didn't work either. I misspoke. I don't have other forms that do this. I have reports. Maybe you can't do it in a form.

  4. #4
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You could have a pre-form, one that opens before the main form, where they enter the value.
    You could have the field on the main form itself and requery the form after they enter.
    You could have the query as a parameter that the user enters.

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

Similar Threads

  1. Event procedure
    By vugar in forum Access
    Replies: 3
    Last Post: 09-09-2014, 11:36 PM
  2. Replies: 1
    Last Post: 03-29-2014, 07:46 PM
  3. Replies: 1
    Last Post: 03-11-2014, 09:29 AM
  4. Access 2010 Query or Event Procedure Issue?
    By justphilip2003 in forum Queries
    Replies: 22
    Last Post: 04-19-2013, 02:39 PM
  5. Replies: 3
    Last Post: 05-07-2012, 12:17 PM

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