Results 1 to 4 of 4
  1. #1
    ilikebirds is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    14

    Access 2007 - Multiple Subform Onload


    I have a Form with 2 subforms. One subform has an onload property to adjust columnwidths. I am trying to do the same for the other subform - but I get the following error:
    The Expression on load you entered as the event property setting produced the following error: A problem occurred while micorosft office access was communicating with the OLE server or Active X Control.

    Any ideas?

  2. #2
    ilikebirds is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    14
    In the same vein - I'm having an issue when I add a second subform to the following after update event:

    On Error GoTo Proc_Error
    If IsNull(Me.Combo4) Then
    Me.Billingsubform.Form.Filter = ""
    Me.Billingsubform.Form.FilterOn = False
    Me.PhaseQuerysubform.Form.Filter = ""
    Me.PhaseQuerysubform.Form.FilterOn = False



    Else
    Me.Billingsubform.Form.Filter = "[Programname]=" & Me.Combo4
    Me.Billingsubform.Form.FilterOn = True
    Me.PhaseQuerysubform.Form.Filter = "[Programcode]=" & Me.Combo4
    Me.PhaseQuerysubform.Form.FilterOn = True

    End If
    Proc_Exit:
    Exit Sub
    Proc_Error:
    MsgBox "Error " & Err.Number & " in setting subform filter:" & vbCrLf & Err.Description
    Resume Proc_Exit
    End Sub


    It works with just Billingsubform but if I add Phasequerysubform it fails.

  3. #3
    ilikebirds is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    14
    [SOLUTION] I figured out the Subform AfterUpdate issue. You have to split it into 2 different IF and Else Statements:
    On Error GoTo Proc_Error
    If IsNull(Me.Combo4) Then
    Me.Billingsubform.Form.Filter = ""
    Me.Billingsubform.Form.FilterOn = False
    Else
    Me.Billingsubform.Form.Filter = "[Programname]=" & Me.Combo4
    Me.Billingsubform.Form.FilterOn = True


    End If
    If IsNull(Me.Combo4) Then

    Me.PhaseQuerysubform.Form.Filter = ""
    Me.PhaseQuerysubform.Form.FilterOn = False
    Else

    Me.PhaseQuerysubform.Form.Filter = "[Programcode]=" & Me.Combo4
    Me.PhaseQuerysubform.Form.FilterOn = True

  4. #4
    ilikebirds is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    14
    [Solution] Back to answer my own question again. The onload worked for somereason - I can't figure out why it was giving me an error before but here was the code on the second subforms on load:

    Private Sub Form_Load()
    Me.Phase1.ColumnWidth = 1 * 1440
    Me.Phase2.ColumnWidth = 1 * 1440
    Me.Phase3.ColumnWidth = 1 * 1440
    Me.Text12.ColumnWidth = 1.5 * 1440
    Me.Text14.ColumnWidth = 1.5 * 1440
    Me.Text16.ColumnWidth = 1.5 * 1440

    End Sub

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

Similar Threads

  1. Export Table in Access 2007 to Multiple Workbooks in Excel 2007
    By hutchinsm in forum Import/Export Data
    Replies: 5
    Last Post: 03-01-2012, 05:23 PM
  2. Replies: 1
    Last Post: 03-01-2012, 09:06 AM
  3. Junction table in subform in Access 2007
    By BrizzoRay in forum Forms
    Replies: 1
    Last Post: 12-18-2011, 01:43 AM
  4. Replies: 6
    Last Post: 10-21-2011, 10:24 PM
  5. Replies: 3
    Last Post: 08-08-2010, 05:33 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