Results 1 to 6 of 6
  1. #1
    kazaccess is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jul 2013
    Posts
    43

    File Continually Crashes - Possible VBA Issues?

    I have a main form that houses a subform. If I click a value in the subform, it will filter the main form to that value. However, my Access has been crashing (starting today) when I perform this action, and I'm thinking it may possibly related to the VBA I have performing this filter action. See my code below. This was working without issue the last few days, but today it began crashing without any updates to my code at all.

    Code:
    Dim strFilter As String    On Error GoTo ErrHandler
        'If the clicked text box has a value, then filter my main form to the record matching the clicked value
        If Forms![Load Planning]![DailyFile subform].Form!Text14.Text <> "" Then
            strFilter = "[Order Line Key] Like '*" & Forms![Load Planning]![DailyFile subform].Form!Text14.Text & "*'"
            Forms![Load Planning].Filter = strFilter
            Forms![Load Planning].FilterOn = True
        Else
            Forms![Load Planning].Filter = ""
            Forms![Load Planning].FilterOn = False
        End If
        Exit Sub
    ErrHandler:
        MsgBox Err.Description, vbExclamation
    
    
        DoCmd.SetWarnings (WarningsOn)
    By crashing, I mean that I get the popup telling me to search for a solution online or restart Access. No other error messages appear.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    It is unusual to have a subform dictate to the main form. Why are you doing this? What is the relationship of main and sub forms?
    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
    kazaccess is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jul 2013
    Posts
    43
    When the subform value is clicked, the main form will be filtered to that value so that the user can update/add items to that record from the main form. The subform is a different table/query than my main form.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Sorry, that doesn't make sense. In a conventional form/subform arrangement where the datasets have a dependent relationship, the main form dictates which related records show on the subform. Are Master/Child Link properties set?
    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.

  5. #5
    kazaccess is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jul 2013
    Posts
    43
    Sorry, I could have been clearer. No, I do not have master-child relationships set up. Both tables used here have the same primary key, but it is possible for both tables to have different records (they are not joined). Therefore, my subform acts as a lookup. When that primary key value is clicked, it will look up that value in my main form and display its contents.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    So both forms have the same data source? A combobox or listbox is more commonly used for selection of filter criteria. Review http://www.allenbrowne.com/ser-62.html

    Perhaps you should look at the Split form object.
    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.

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

Similar Threads

  1. Replies: 6
    Last Post: 03-05-2015, 01:42 PM
  2. Issues with Word File tab after Merge Started from VBA
    By drexasaurus in forum Programming
    Replies: 0
    Last Post: 07-28-2014, 10:32 AM
  3. Replies: 2
    Last Post: 01-30-2013, 06:48 AM
  4. .ldb file issues
    By RachelBedi in forum Access
    Replies: 3
    Last Post: 12-12-2012, 10:47 AM
  5. Export to excel (File Name issues)
    By fpmsi in forum Import/Export Data
    Replies: 6
    Last Post: 09-22-2011, 02:09 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