Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Evansville, Indiana, USA
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Subform Help (2007)

    I have attached the current database I am working on. I am fighting two problems. Both problems reside in frmAddPO. I can't figure out how to get txtExtension, on the subform, to add correctly. Currently txtExtension is calculated by multiplying txtqty by txtprice. That part works fine. I then have a textbox in the footer of the subform calculate the sum of the txtExtension column. For some reason, this doesn't work.
    The other problem has to do with the txtShipping. When you input a value in the text box, the form jumps to the next record and clears the subform.
    Can someone please take a look at my database?
    Thanks,
    BZ
    PS. I tried to save it to a 2002 format in case others don't have 2007, but my forms won't open. Does anyone know how to handle this.
    Attached Files Attached Files

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

    Re: Subform Help (2007)

    I don't have a 2007 computer handy at the moment so I can't look at your db, but:

    * If you want to sum the extensions, perform the calculation in the query behind the form, rather than directly in the form. You can't total fields calculated on the form.

    * It sounds like txtshipping is the last field on the subform, and you are then tabbing to a new record. Try setting the cycle property of the subform to current record.
    Regards
    John



  3. #3
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Evansville, Indiana, USA
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Help (2007)

    Thanks for the reply.

    You were correct on the last field of the subform. I made the correction and now it works fine.

    I am in the progress of making the total query. I think there is a problem with my subform though. I want tblPO to have an entry for each item listed in the subform. Right now, each item has a record, but that record does not include any of the data from the fields on the host form. The host form fields have their own record in the table. Do you know how I can fix this.

    Thanks,
    BZ

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

    Re: Subform Help (2007)

    Sorry my previous reply was unclear.

    You can do the summing in the form, if you perform the multiplication in the query.

    so instead of having txtExtension = txtPrice * txtqty, have a calculated field in the query:

    Extendedprice: [price]*[qty] then set the recordsource of txtExtension to ExtendedPrice

    You should then be able to sum it in the form footer.
    Regards
    John



Posting Permissions

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