Hello!
I made a form, containing project, site, stock and unit price. project and site are stored in table Project. stock and unit price are stored in table Stock_Name and Stock_Price. I tried to make site and unit price be filled in automatically according to project and sotck, but I met several problems.
Q1. I hope site can automatically show after project is selected and the content of site can be changed manually. So I tried to use DLookup to resolve problem like this:
But nothing showed up. Can anyone tell me what happened with my code and how can I corrected it?
Q2. Table Stock_Name and Stock_Price stores the information about stock, containing stock, unit price and updated time (of unit price). I hope the latest unit price of the stock shows after the stock is selected. The history record could not be changed due to the update of the unit price. How can I do to achieve this? Or which fn could I use?
This is my test file: https://reurl.cc/Krbrve
Thanks in advance!
I made a form, containing project, site, stock and unit price. project and site are stored in table Project. stock and unit price are stored in table Stock_Name and Stock_Price. I tried to make site and unit price be filled in automatically according to project and sotck, but I met several problems.
Q1. I hope site can automatically show after project is selected and the content of site can be changed manually. So I tried to use DLookup to resolve problem like this:
Code:
Private Sub project_AfterUpdate()
Me![site] = DLookup("site", "Project", [No] = Me![project])
End Sub
Q2. Table Stock_Name and Stock_Price stores the information about stock, containing stock, unit price and updated time (of unit price). I hope the latest unit price of the stock shows after the stock is selected. The history record could not be changed due to the update of the unit price. How can I do to achieve this? Or which fn could I use?
This is my test file: https://reurl.cc/Krbrve
Thanks in advance!