Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Show / Hide Subform

Discussion in 'Information Technology' started by l, Jul 28, 2006.

Tags:
  1. l

    l
    Expand Collapse
    Guest

    I am working with a conditional script to show/hide a subform. The
    name of the subform happens to already have a space in it ("Orders
    Subform"). Could this cause problems? My subform has the name "Orders
    Subform", yet I get an error message when I include it.

    Can anyone suggest steps to take in debugging this? Thanks - Louis

    Currently, I am using the following script in the "parent" form:
    ---------------------------------------
    Private Sub EmployeeID_Change()
    On Error Resume Next

    Dim strSubformName As String

    ' Based on the page selected, set the Subform Name variable
    Select Case Me.EmployeeID
    Case 0: strSubformName = ""
    Case 1: strSubformName = "Orders Subform"
    Case Else: strSubformName = "apple"
    End Select

    ' If a subform exists, then set the properties, otherwise
    ' just hide the generic subform object
    If strSubformName = "" Then
    Me.Orders Subform.Visible = False

    Else

    Me.Orders Subform.SourceObject = strSubformName
    Me.Orders Subform.LinkMasterFields = "pub_id"
    Me.Orders Subform.LinkChildFields = "pub_id"

    Me.Orders Subform.Visible = True
    End If

    End Sub
     
  2. Loading...


  3. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    I personally *hate* Variables, Objects Tables and Or Fields with spaces
    but
    Me.[Orders Subform].Visible = False
    or
    Me.Orders_Subform.Visible = False
    should both work

    Pieter

    Hungarian notation was invented to avoid this
    ie use

    ALPHA_ALPHA (MSSQL & Oracle do Support mixed case as in "My Table" instead
    of MY_TABLE but you have to enquote & type exactly as defined)
    or
    AlphaAlpha (For Forms & Reports - OrdersSubForm is just as readable)





    "l" <barn104_1999@yahoo.com> wrote in message
    news:1151437962.929438.195380@x69g2000cwx.googlegroups.com...
    >I am working with a conditional script to show/hide a subform. The
    > name of the subform happens to already have a space in it ("Orders
    > Subform"). Could this cause problems? My subform has the name "Orders
    > Subform", yet I get an error message when I include it.
    >
    > Can anyone suggest steps to take in debugging this? Thanks - Louis
    >
    > Currently, I am using the following script in the "parent" form:
    > ---------------------------------------
    > Private Sub EmployeeID_Change()
    > On Error Resume Next
    >
    > Dim strSubformName As String
    >
    > ' Based on the page selected, set the Subform Name variable
    > Select Case Me.EmployeeID
    > Case 0: strSubformName = ""
    > Case 1: strSubformName = "Orders Subform"
    > Case Else: strSubformName = "apple"
    > End Select
    >
    > ' If a subform exists, then set the properties, otherwise
    > ' just hide the generic subform object
    > If strSubformName = "" Then
    > Me.Orders Subform.Visible = False
    >
    > Else
    >
    > Me.Orders Subform.SourceObject = strSubformName
    > Me.Orders Subform.LinkMasterFields = "pub_id"
    > Me.Orders Subform.LinkChildFields = "pub_id"
    >
    > Me.Orders Subform.Visible = True
    > End If
    >
    > End Sub
    >
     
  4. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    I personally *hate* Variables, Objects Tables and Or Fields with spaces
    but
    Me.[Orders Subform].Visible = False
    or
    Me.Orders_Subform.Visible = False
    should both work

    Pieter

    Hungarian notation was invented to avoid this
    ie use

    ALPHA_ALPHA (MSSQL & Oracle do Support mixed case as in "My Table" instead
    of MY_TABLE but you have to enquote & type exactly as defined)
    or
    AlphaAlpha (For Forms & Reports - OrdersSubForm is just as readable)





    "l" <barn104_1999@yahoo.com> wrote in message
    news:1151437962.929438.195380@x69g2000cwx.googlegroups.com...
    >I am working with a conditional script to show/hide a subform. The
    > name of the subform happens to already have a space in it ("Orders
    > Subform"). Could this cause problems? My subform has the name "Orders
    > Subform", yet I get an error message when I include it.
    >
    > Can anyone suggest steps to take in debugging this? Thanks - Louis
    >
    > Currently, I am using the following script in the "parent" form:
    > ---------------------------------------
    > Private Sub EmployeeID_Change()
    > On Error Resume Next
    >
    > Dim strSubformName As String
    >
    > ' Based on the page selected, set the Subform Name variable
    > Select Case Me.EmployeeID
    > Case 0: strSubformName = ""
    > Case 1: strSubformName = "Orders Subform"
    > Case Else: strSubformName = "apple"
    > End Select
    >
    > ' If a subform exists, then set the properties, otherwise
    > ' just hide the generic subform object
    > If strSubformName = "" Then
    > Me.Orders Subform.Visible = False
    >
    > Else
    >
    > Me.Orders Subform.SourceObject = strSubformName
    > Me.Orders Subform.LinkMasterFields = "pub_id"
    > Me.Orders Subform.LinkChildFields = "pub_id"
    >
    > Me.Orders Subform.Visible = True
    > End If
    >
    > End Sub
    >




    --
    ----------------------------------------
    I am using the free version of SPAMfighter for private users.
    It has removed 4079 spam emails to date.
    Paying users do not have this message in their emails.
    Get the free SPAMfighter here: http://www.spamfighter.com/len
     

Share This Page