First, I am learning so much from all of the courses I've taken! Thank you.
Now to my issue: I have created both the Vendor to Products and Products to Vendor forms and they work great. Except I have to have the Product Form open in order for the "Profit" field to properly calculate on the Vendor form. Any suggestions?
Should I post this to the E8 Forum also? I've looked on both and do not see where anyone has addressed this.
Sorry it has taken me so long to see this. I missed this thread earlier. I'm glad the courses have been helping, and thanks, Alex, for asking about opening the form on its own.
Angela, you don't need to repost this in Expert 8. I cover this exact issue around 17:00 in Access Expert 8, Lesson 1 (Products to Vendors). The original Profit expression reads the current UnitPrice on ProductF. When that form is closed, you get #Name?. Opening it makes the calculation run, but it uses that one product's price for every row.
The fix is on the VendorF side: join VendorXProductT to ProductT on ProductID, keep the junction table fields, and bring in UnitPrice from ProductT. Add Profit: [UnitPrice]-[UnitCost] to the query. Set VendorProductSubF's Record Source to that query and the Profit text box's Control Source to Profit, replacing the old expression that refers to ProductF. Now each row uses its own product's price, even with ProductF closed.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.