S
Stefan
I want to find the last record and price for a stock in another table. During
this time I have found that Dlast is the function I want. But it is not
giving me the result I want and I know why now.
It’s an easy thing with dlast. When the user clicks a combobox of the stock
the last price executed should be default. Like this:
Private Sub Stock_Change()
Dim dblLastStockValue As Double
dblLastStockValue = DLast("[Price]", " tblExecuted", "[StockNo]=" &
Me.Stock)
Price.Value = dblLastStockValue
End Sub
I have been struggling around with Dlookup and Dmax without any luck and
would appreciate some guidance in the right direction. Maybe Dlookup with
Dmax is’t appropriate here?
I have two tables with stocks. One table with unexecuted orders and one with
executed orders. The structure of the tables is almost the same.
tblExecuted
OrderNo Stock Price
1 AAA 50
2 BBB 70
3 AAA 55
4 AAA 65
5 BBB 75
6 CCC 62
On the form of the tblUnexecuted Orders, the user selects the AAA stock, I
want the last price of AAA to be 65 in the textbox, and BBB would generate 75.
Any suggestions without using Dlast?
TIA
Stefan
this time I have found that Dlast is the function I want. But it is not
giving me the result I want and I know why now.
It’s an easy thing with dlast. When the user clicks a combobox of the stock
the last price executed should be default. Like this:
Private Sub Stock_Change()
Dim dblLastStockValue As Double
dblLastStockValue = DLast("[Price]", " tblExecuted", "[StockNo]=" &
Me.Stock)
Price.Value = dblLastStockValue
End Sub
I have been struggling around with Dlookup and Dmax without any luck and
would appreciate some guidance in the right direction. Maybe Dlookup with
Dmax is’t appropriate here?
I have two tables with stocks. One table with unexecuted orders and one with
executed orders. The structure of the tables is almost the same.
tblExecuted
OrderNo Stock Price
1 AAA 50
2 BBB 70
3 AAA 55
4 AAA 65
5 BBB 75
6 CCC 62
On the form of the tblUnexecuted Orders, the user selects the AAA stock, I
want the last price of AAA to be 65 in the textbox, and BBB would generate 75.
Any suggestions without using Dlast?
TIA
Stefan