B
Brian
I have a table - tblProducts with
prodNum (text)
prodDesc (text)
A form populates a table tblOrders with
ordProdNum (text)
ordodDesc (text)
I want the product description to come up with the entry of the product number
The code:
Private Sub ordProdNum_AfterUpdate()
On Error GoTo Err_ordProdNum_AfterUpdate
Dim strProdNum As String
' Evaluate filter before it's passed to DLookup function.
strProdNum = "prodNum = " & Me!ordProdNum
' Look up product numbers assign it to ordProdDesc control.
Me!ordProdDesc = DLookup("[prodDesc]", "[tblProducts]", strProdNum)
Exit_ordProdNum_AfterUpdate:
Exit Sub
Err_ordProdNum_AfterUpdate:
MsgBox Err.Description
Resume Exit_ordProdNum_AfterUpdate
End Sub
When the ordProdNum control updated, I get a data type mismatch error
I know I can accomplish the same thing with a query, but am getting nowhere
with that as well
How can I get the product description field to populate be entering the
product number?
prodNum (text)
prodDesc (text)
A form populates a table tblOrders with
ordProdNum (text)
ordodDesc (text)
I want the product description to come up with the entry of the product number
The code:
Private Sub ordProdNum_AfterUpdate()
On Error GoTo Err_ordProdNum_AfterUpdate
Dim strProdNum As String
' Evaluate filter before it's passed to DLookup function.
strProdNum = "prodNum = " & Me!ordProdNum
' Look up product numbers assign it to ordProdDesc control.
Me!ordProdDesc = DLookup("[prodDesc]", "[tblProducts]", strProdNum)
Exit_ordProdNum_AfterUpdate:
Exit Sub
Err_ordProdNum_AfterUpdate:
MsgBox Err.Description
Resume Exit_ordProdNum_AfterUpdate
End Sub
When the ordProdNum control updated, I get a data type mismatch error
I know I can accomplish the same thing with a query, but am getting nowhere
with that as well
How can I get the product description field to populate be entering the
product number?