Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2023
    Posts
    9

    Open a form with AfterUpdate Event


    Hello Forum Members


    I have two forms:


    ReferenceLiterature with AfterUpdate Event and Split Form

    Code:
    Private Sub FindCompany_AfterUpdate() 
        Me.Filter = "AppliesTo=""" & FindCompany & """" 
        Me.FilterOn = True 
    
    
        DoCmd.OpenForm "ReferenceLiterature_SearchResults", acFormFS, , , , acHidden 
        Forms!ReferenceLiterature_SearchResults.RecordSource = strSQL 
        DoCmd.OpenForm "ReferenceLiterature_Searchresults", acFormFS 
    
    
    End Sub
    I want to open the ReferenceLiterature_SearchResults form with the filtered records, but it is currently not working.
    If I remove the OpenForm, then, AfterUpdate Event itself is just working fine.
    Would you please help me how this can be accomplished?

    ReferenceLiterature_SearchResults with WebBowser Control and Single Form to see the PDFs.

    Thank you.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Instead of setting RecordSource, use WHERE CONDITION argument of OpenForm.

    DoCmd.OpenForm "ReferenceLiterature_Searchresults", acFormFS, , "AppliesTo=""" & FindCompany & """"

    How is strSQL set anyway?
    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.

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    No, Me works on the current form wher the code is running.?

    What is this meant to be?
    ReferenceLiterature_SearchResults with WebBowser Control and Single Form to see the PDFs.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    Join Date
    Mar 2023
    Posts
    9
    Hello June 7

    Your suggestion just works great, and this is what I wanted to do.
    Thank you so much for your help, I sincerely appreciate it.


    Hello Welshgasman

    ReferenceLiterature_SearchResults with WebBowser Control and Single Form to see the PDFs has a WebBrowser Control and I can see the PDF inside the Access form after the AfterUpdate Event, while ReferenceLiterature with AfterUpdate Event and Split Form is a Split Form and the half of the Windows occupies literature titles.

    Thank you again.

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

Similar Threads

  1. afterupdate event in a form
    By angie in forum Access
    Replies: 2
    Last Post: 04-03-2018, 05:35 PM
  2. AfterUpdate() Event To Filter Sub Form
    By chalupabatman in forum Programming
    Replies: 8
    Last Post: 11-06-2017, 01:36 PM
  3. Replies: 4
    Last Post: 10-29-2014, 03:49 PM
  4. Replies: 2
    Last Post: 06-09-2012, 01:56 AM
  5. Form AfterUpdate Event
    By RayMilhon in forum Forms
    Replies: 2
    Last Post: 09-09-2011, 09:20 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