Results 1 to 9 of 9

Thread: subform (2003)

  1. #1
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    subform (2003)

    Hi,

    I have a subform that pops up when I do a selection on 4 cascading combo boxes on a main form. The subform gives me info about category and pricing. However, there are 2 types of categories that do not have pricing and it says staged pricing. On those 2 that have no pricing, I need to double click on the pricing box on the subform and run a query. When I run the query, I only want it to bring back information on that category. How would I accompish this? Would I somehow have to reference the category box on the subform to make the query work?


    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: subform (2003)

    Let's get our terminology straight first. The 'official' meaning of a subform is a form that is embedded in another form (the 'main' form). It doesn't 'pop up'.

    Are you talking about a real subform, or about a separate form that is opened from another form?

  3. #3
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: subform (2003)

    It is an embedded subform based on a query that uses the 4 cascading combo boxes on the main form to populate the subform.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: subform (2003)

    Yes. You can refer to a control on a subform like this:

    Forms!MainFormName!SubFormName!ControlName

    where SubFormName is the name of the subform as a control on the main form. If you open the main form in design view and click once on the subform, you'll see the control name in the title bar of the Properties window and of course in the Name property. This is not necessarily the same as the name of the subform in the database window.

    Note: if any of the names contains spaces, punctuation or other unusual characters, you must enclose it in square brackets, e.g. [SubForm Name]

  5. #5
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: subform (2003)

    I am building a new database and referencing a subform and I am using this as the control source =Sum(Forms!FRMMENU!FRMSUBDETAIL!CLAIMS) and it is giving me an error message in the text box which is unbound on the main form. I have checked all the names on the forms. What can I be doing wrong?

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: subform (2003)

    To transfer a total from a subform to a main form, do the addition in the form footer of the subform, then transfer the result to the main form.

    In the subform footer you can use =sum([Claims]). Call this control : txtTotalClaim

    Then on the main form where you want the total to appear, set its control source to: = frmsubdetail.form!txtTotalClaim
    frmsubdetail needs to be the name of the subform control, which may be different to the actual subform.
    You can use the expression builder to build that expression. Just click the three dots to the right of "Control Source"

    ps You can hide the total on the subform if you only want it it one place.
    Regards
    John



  7. #7
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: subform (2003)

    thanks that works.

  8. #8
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: subform (2003)

    I have a document that I do not remember where it is from so I cannt credit the proper peson but it is a tremendous help for thigs like this. It is called Syntax for Subs and has all the possibilities. I have attached it
    Attached Files Attached Files

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: subform (2003)

    That info is from Dev Ashish's Access Web, it has been mentioned many times in this forum.

    The original can be found in Forms: Refer to Form and Subform properties and controls.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •