TVReplay99
Registered User.
- Local time
- Today, 10:35
- Joined
- Jan 2, 2002
- Messages
- 29
I think I am having a serious brain fart.
I have a sipmle Order form and Order Deatils subform. The order for works fine and so does the subform, sorta. I have not been able to populate the UnitPrice field on the subform after I select the Item from the StockNo combo box.
The form is based on this Query:
SELECT
tblTransDetail.TransasctionNo,
tblTransDetail.StockNo,
tblTransDetail.TransQuantity,
tblTransDetail.TransUnitPrice,
tblStock.Desc,
[TransQuantity]*[TransUnitPrice] AS LineTotal
FROM tblStock INNER JOIN tblTransDetail ON tblStock.StockNo = tblTransDetail.StockNo;
I have tried this Code but to no avail.
Private Sub StockNo_AfterUpdate()
On Error GoTo Err_StockNo_AfterUpdate
Dim strFilter As String
strFilter = "StockNo = " & Me!StockNo
Me!TransUnitPrice = DLookup("Price", "tblStock", strFilter)
Exit_StockNo_AfterUpdate:
Exit Sub
Err_StockNo_AfterUpdate:
MsgBox Err.Description
Resume Exit_StockNo_AfterUpdate
End Sub
Thank you for any assistance.
I have a sipmle Order form and Order Deatils subform. The order for works fine and so does the subform, sorta. I have not been able to populate the UnitPrice field on the subform after I select the Item from the StockNo combo box.
The form is based on this Query:
SELECT
tblTransDetail.TransasctionNo,
tblTransDetail.StockNo,
tblTransDetail.TransQuantity,
tblTransDetail.TransUnitPrice,
tblStock.Desc,
[TransQuantity]*[TransUnitPrice] AS LineTotal
FROM tblStock INNER JOIN tblTransDetail ON tblStock.StockNo = tblTransDetail.StockNo;
I have tried this Code but to no avail.
Private Sub StockNo_AfterUpdate()
On Error GoTo Err_StockNo_AfterUpdate
Dim strFilter As String
strFilter = "StockNo = " & Me!StockNo
Me!TransUnitPrice = DLookup("Price", "tblStock", strFilter)
Exit_StockNo_AfterUpdate:
Exit Sub
Err_StockNo_AfterUpdate:
MsgBox Err.Description
Resume Exit_StockNo_AfterUpdate
End Sub
Thank you for any assistance.