Page 4 of 5 FirstFirst 12345 LastLast
Results 46 to 60 of 67
  1. #46
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Perhaps Barry's PF is an indicator that an Order item can associate with only one invoice - can't double bill. order_item_id and invoice_number should be set as compound unique index to prevent duplicate pairs in Invoice_Line_Items.

    However, a job can have multiple invoices (partial billing) until job is completed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  2. #47
    DBID10T is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Posts
    46
    When I am adding a product to a list via a form, I can select the Product via a Combo Box, I am trying to display the tblProduct.PriceRetail for the ProductID being added, to record it in a RetailPrice for the ProjectProduct record.


    hope that makes sense

    DBID10T

  3. #48
    DBID10T is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Posts
    46
    Quote Originally Posted by June7 View Post
    Perhaps Barry's PF is an indicator that an Order item can associate with only one invoice - can't double bill. order_item_id and invoice_number should be set as compound unique index to prevent duplicate pairs in Invoice_Line_Items.

    However, a job can have multiple invoices (partial billing) until job is completed.
    With my newbie DB skillset that was how i interpreted that, i think it's pretty similar to how I am trying to use tblProjectProduct in my current design

  4. #49
    DBID10T is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Posts
    46
    =[tblProject]![PriceRetail] is what I have now and the PriceRetail shows #Name?

  5. #50
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Oh wait, the PF should not be duplicated at all. Compound index would not prevent associating with another invoice. So PF is set as unique so that ID cannot be used more than once in Invoice_Line_Items. It does not have to be a primary key, just set as unique index. You were right, this is a 1-to-1. Invoice_Line_Items actually appears to duplicate fields from Order_Items. Invoice_Line_Items could probably be eliminated by saving InvoiceID into Order_Items.


    You have that where - in textbox? Why do you have table name prefix? Why do you have = sign?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #51
    DBID10T is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Posts
    46
    It's the text Field where I am trying to store the Retail price (which is listed in tblProduct) in that field for each ProjectPurchase Record

    on my Project Purchase Form

    Which hopefully should give me a record of the price the unit was sold for at the time of sale

  7. #52
    DBID10T is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Posts
    46
    ok think I might be getting close,

    I Usually use a Combo box and qry to get the key and the display data for a given cell on a form. I created a qryProductRetail and set the PriceRetail to a text box, then set the qryProductRetail as its control source.....but it's not updating when i change to a different product..

  8. #53
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    A query cannot be a ControlSource.

    You have a combobox to select product? Its RowSource has ID, product description, product price?

    Will require code (macro or VBA) to save price. I use only VBA. Real trick is figuring out what event to put code into. Probably combobox AfterUpdate.

    Me!PriceRetail = Me.Comboboxname.Column(2)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #54
    DBID10T is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Posts
    46
    Quote Originally Posted by June7 View Post
    A query cannot be a ControlSource.

    You have a combobox to select product? Its RowSource has ID, product description, product price?

    Will require code (macro or VBA) to save price. I use only VBA. Real trick is figuring out what event to put code into. Probably combobox AfterUpdate.

    Me!PriceRetail = Me.Comboboxname.Column(2)
    Me!PriceRetail = Me.ProductID_FK.Column(4)

    hmm

    June7 Said "After ComboBox Update"

    hmmm

  10. #55
    DBID10T is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Posts
    46
    June7

    So close I figured out where to put that to activate after combobox update but

    Me!PriceRetail = Me.ProductID_FK.Column(4)


    Did Not change the column read to number4

    My qryProduct queries 4 columns ProductID_FK, ProductName, UOMID_FK, PriceRetail

    my thought was the bolded portion signified column read but changing from 2 to 4 doesn't seem to change that it's reporting on column1

    Thanks for all your tips
    DBID10T

  11. #56
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I actually said "combobox AfterUpdate".

    Are you familiar with VBA event coding? Start with http://baldyweb.com/FirstVBA.htm

    then https://support.office.com/en-us/art...7-70649e33be4f

    Okay, now I see your post.

    The number is combobox column index. Index begins with 0. If desired value is in column 4, its index is 3.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #57
    DBID10T is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Posts
    46
    Quote Originally Posted by June7 View Post
    I actually said "combobox AfterUpdate".

    Are you familiar with VBA event coding? Start with http://baldyweb.com/FirstVBA.htm

    then https://support.office.com/en-us/art...7-70649e33be4f

    Okay, now I see your post.

    The number is combobox column index. Index begins with 0. If desired value is in column 4, its index is 3.
    Ah ha and i was too tired last night to realize i had another typo, i was trying to pull RetailPrice from tblProject instead of tblProduct, and 3 instead of 4 for the col number,

    Thanks as always

  13. #58
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Shall we call this thread solved?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  14. #59
    DBID10T is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Posts
    46
    Quote Originally Posted by June7 View Post
    Shall we call this thread solved?

    No I call it progressing slowly

    If i might query you again

    I am Working on my Forms and Such and I am working with this expression

    DLookup("CustomerType", "tblCustomerType", "CustomerID_PK = " & [CustomerID_PK])

    Should Reference field CustomerType in tblCustomerType when control source CustomerID_PK shows the actual ID number

    It doesn't seem to be working quite right

    Thanks in Advance,
    DBID10T


    DLookup("CustomerType", "tblCustomerType", "TxtBoxCustomerID = " & [CustomerID_PK])

    Didnt fix it

  15. #60
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    tblCustomerType has a field called CustomerID_PK? or is it CustomerID_FK?

    Actually, why would you look at tblCustomerType to determine what type a customer is? Shouldn't the type be a foreign key field in tblCustomers?

    Really need to close this thread as the original question has been resolved and you have moved well beyond it. As you encounter new issues, post new questions.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Page 4 of 5 FirstFirst 12345 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Help please, total newbie in the deep dish
    By Peanutdust in forum Reports
    Replies: 2
    Last Post: 09-14-2017, 05:35 AM
  2. Newbie getting stuck with summing queries
    By snorky in forum Access
    Replies: 2
    Last Post: 01-19-2012, 03:42 PM
  3. stuck on expression for total query records
    By pacer31 in forum Queries
    Replies: 3
    Last Post: 07-04-2011, 11:30 AM
  4. Newbie Here & Stuck
    By FOZILD in forum Access
    Replies: 5
    Last Post: 09-24-2009, 08:26 AM
  5. :?: newbie...grand total?
    By PnerraD in forum Access
    Replies: 1
    Last Post: 08-24-2006, 06:28 PM

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