Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    ryanwales is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    27

    Making price appear automatically in form

    Hi and thanks for reading! Hopefully you can help me,

    I have a form, namely QuoteForm, where the user enters data resulting in saving a record and printing out the Quote.

    The user has the ability to choose multiple products via a subform (QuoteDetails) that has a master/child link with the QuoteForm.

    Here goes - In QuoteDetails, the user selects the product name, quantity, list price, discount. What I would like to happen is once the user selects the product, the list price should automatically appear

    All products are stored in the Products table with assigned prices. What I am after is once the product is chosen, the ListPrice in the Products table appears on ListPrice in quoteDetails.

    There are relationships throughout the form and subform listed below:
    Quote -> CustomerID (Customer Table)
    Salesperson (Employee Table)

    QuoteDetails -> QuoteID (Quote)
    ProductID -> ID (Products Table)
    ProductName -> ProductName (")



    I have looked around but and I see I may have to create a query and create the subform from that? Or is there a way to make the ListPrice display another way?

    Thank you in advance

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Sounds like this would work:

    http://www.baldyweb.com/Autofill.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ryanwales is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    27
    that looks tasty. Hopefully I can nip this in the bud! Thanks

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    No problem; post back if you get stuck.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    ryanwales is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    27
    Ignore this, wrote the wrong thing in this field and cant find delete post :S
    Last edited by ryanwales; 10-26-2011 at 04:33 AM. Reason: incorrect

  6. #6
    ryanwales is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    27

    Post

    works like a charm. thank you very much!

    On from this..there is a sum made (in the footer of the subform) from the totals of the products which is then pushed to the Subtotal in the main form. At the moment I just have the textbox (txtSum) as a control source in txtSubtotal. What I need however, much like the initial problem, is for it to push to the subtotal and be stored in subtotal.

    Do I create an after Update in the txtSum field in VB just like the list price?
    Something like :

    QuoteNew.txtSubtotal = Me.txtSum ?

    Just tried the code above, no errors yet no result. problem with how i'm calling the master form perhaps?

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Looks like it. Here's a good reference on the proper syntax:

    Forms Refer to Form and Subform properties and controls
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    ryanwales is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    27
    I looked at this but I wasnt sure which one would be correct for a field from one subform to the main form?

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Then to be safest you can always use the full reference from the "Not in these forms" section.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    ryanwales is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    27
    I've tried various ones. none come up with an error however none show the data! Do any of these work for text-box's? Any way you can post an example? i want txtSum's data from the subform QuoteDetails (Child10) to be txtQuoteSubtotal in the QuoteNew form

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Forms!QuoteNew.txtQuoteSubtotal = Me.txtSum

    Though I probably wouldn't save the subtotal with the main form's data. I've done it, and users have an uncanny ability to find ways to get the calculated value out of whack with what it should be.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    ryanwales is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    27
    it doesnt show in the form! i even tried it in a completely different text box.

    what would you suggest?

  13. #13
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Where do you have the code?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  14. #14
    ryanwales is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    27
    Quote Originally Posted by pbaldy View Post
    Where do you have the code?
    I placed the code in the after update section of txtSum. SHould it be somewhere else?

  15. #15
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    A calculated control's update event doesn't fire when the value changes. You need to use another event, perhaps the after update event of the control the user inputs into. This is one of the many reasons we recommend not saving calculated values.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 08-25-2011, 02:28 PM
  2. making expire ms access form..
    By alex_raju in forum Access
    Replies: 2
    Last Post: 07-13-2011, 11:27 AM
  3. Making a PurchaseOrder form
    By blueraincoat in forum Forms
    Replies: 5
    Last Post: 04-06-2011, 06:43 AM
  4. Making a Stand Alone Form Available
    By PapaMammoo in forum Forms
    Replies: 1
    Last Post: 01-13-2011, 10:49 AM
  5. Replies: 2
    Last Post: 09-10-2009, 08:21 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums