Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2008
    Posts
    5

    Red face Unanswered: Subform totals to Main form issues...

    Hello all,

    I've done all the research I can do on the issue I'm having. I've got a subform with 2 calculated fields on it:
    subform: frmJobDetails (datasheet view)
    detail field 1: txt_price_extended
    recordsource = Format([QTY]*[Price],"Currency")
    detail field 2: txt_units_extended
    recordsource = [Units]*[QTY]
    footer field 1: txt_price_subtotal
    recordsource = Sum([QTY]*[Price])
    footer field 2: txt_units_subtotal
    recordsource = Sum([Units]*[QTY])

    main form: frmJob (single form view)
    field 1: txt_cost_extended_from_frmJobDetails
    recordsource = Format(frmJobDetails.Form!txt_price_subtotal,"Curr ency")
    field 2: txt_units_extended_from_frmJobDetails
    recordsource = frmJobDetails.Form!txt_units_subtotal

    Hopefully that's enough to give you a visual...

    The problem is, if I assign the recordsource to footer field 2 as above, I get the dreaded #error in BOTH footer field 1 and footer field 2. If I just run with the "price" fields set up (with no recordsource assigned to the "units" footer field) they work as expected. I'm at a loss here guys, please end my misery! In a nutshell, 1 calculation and echo to main form works great... 2 calculations and echoes causes both to not work?

    Thank you to all that can help!
    Kevlar

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I think you mean ControlSource, not RecordSource.

    Could it be this in conjunction with the inline editing bug? ...

    If you go to edit a subform while it is on your mainform in design mode, you select a subform object (like a text box) to edit it and it looks selected, but the property sheet is giving you the subform's FORM properties, no matter what is actually selected. Combine that with your apparent confusion between ControlSource and RecordSource and you might actually be inadvertently changing the RecordSource for the form instead of the ControlSource for the control.

    If it's not that, then I am at a bit of a loss... with this configuration, setting a control source for footer field 2 should not affect footer field 1.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Sep 2008
    Posts
    5

    Thanks StarTrekker

    You are very correct in the references to csource and rsource...In the heat of trying to describe my problem, I mis-typed. Anyhow, I meant to say controlsource, and they are referenced correctly in my forms. As far as selecting the control in the subform, rather than the subform itself, we're good there too. I have also tried editing directly from the subform "native" form...to no avail! Any other thoughts?

    Kevlar
    Attached Thumbnails Attached Thumbnails Jobs-Form-Problem.gif  

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Beats me tbh... Any chance you can upload it? I'm sure I can find a solution for you that way. But from what you have documented here, it should work... as far as I can tell.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    Sep 2008
    Posts
    5

    Thanks again Trekker

    What portions of the db would I need to upload, and how would I go about that?

    Thanks,

    Kevlar

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    If it's small enough, you should be able to just ZIP the whole MDB file and upload the ZIP file.

    You can zip a file by right clicking it and using Send To ► Compressed (zip) Folder.

    You can upload a file by using the Manage Attachments button in the Post Reply screen.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  7. #7
    Join Date
    Sep 2008
    Posts
    5

    Thanks so much Trekker

    Well, here goes... Keep in mind that it is VERY rough. (you may have to launch the "Jobs" form from the db window...rather than my "switchboard")

    Thanks again,

    Kevlar
    Attached Files Attached Files

  8. #8
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Ah, I don't think you can do that... you have a subform which has a subform and you are also showing the datasheet view. I'm not sure you can reference the Form! object from a form which is in datasheet view. Not sure though because I NEVER use datasheet view

    I suggest you make a separate form for your subform object rather than using a mainform with a subform as a subform.

    You also have a couple of references that are not standard... something about flexigrid... that I had to take away to get the form to even run
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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