Question

  • Creator
    Topic
  • #2265901

    ms access 2003 form/subform

    Locked

    by bernie ·

    Dear All

    I am trying to have dynamic subforms whereby the variables for the relevant subforms are dynamically assigned by the program.

    Would anyone know how to go about this?

    All efforts like me!sub.controls = “f_customer_details1” etc. failed.

    Rgds

All Answers

  • Author
    Replies
    • #2577270

      Clarifications

      by bernie ·

      In reply to ms access 2003 form/subform

      Clarifications

    • #2578483

      sample forms

      by sgt_shultz ·

      In reply to ms access 2003 form/subform

      are you able to download the sample access forms from dwww.microsoft.com/downloads

      HIH you get started.

      • #2579729

        form / subform

        by bernie ·

        In reply to sample forms

        I managed to type a function call with variable form names like this:

        call from form/procedure:

        Dim strMainform As String
        Dim strSubformControlName As String
        Dim strControlName As String

        strMainform = “f_trip_header”
        strSubformControlName = “varform”
        strControlName = “f_trip_details”

        Forms(strMainform)(strSubformControlName).Visible = True

        Call variableform(strMainform, strSubformControlName, strControlName)
        Forms(strMainform)(strSubformControlName).LinkMasterFields = “Counter”
        Forms(strMainform)(strSubformControlName).LinkChildFields = “parentlink”

        actual function in module1/formutilites:

        Public Function variableform(strMainform As String, strSubformControlName As String, strControlName As String)

        ‘mainform: form1
        ‘subform: subform
        ‘sourceobject: f_customer

        MsgBox (strMainform & ” ” & strSubformControlName & ” ” & strControlName)

        Forms(strMainform)(strSubformControlName).SourceObject = (strControlName)

        This was a tough one and I hope some folks can benefit from this little function that dynamically allows you open subforms.

Viewing 1 reply thread