DaniBoy
Registered User.
- Local time
- Today, 08:02
- Joined
- Nov 18, 2001
- Messages
- 174
Hello,
I have copy this code and modified it from the Northwind database. Its a code that looks up the value of the UnitPrice field from the Products Table and puts this value on the UnitPrice field on the Orders Subform. All I chnaged was the field name and the table name but I get this messege when I try it:
The expression you entered as a query parameter produced this Error: 'The object does'nt contain the Anomation object "Fri."
I looked at all the fields used om my database, and compare them with the Northwind, the only difference is that am using a text field instead of a Autonumber for ProductID, the rest is the same.
What do I need to change? I attached a copy of my DB so you can see my problem.
Private Sub ProductoID_AfterUpdate()
On Error GoTo Err_ProductoID_AfterUpdate
Dim Filter As Currency
' Evaluate filter before it's passed to DLookup function.
Filter = "ProductoID = " & Me!ProductoID
' Look up product's unit price and assign it to UnitPrice control.
Me!Precio = DLookup("Precio", "Productos", Filter)
Exit_ProductoID_AfterUpdate:
Exit Sub
Err_ProductoID_AfterUpdate:
MsgBox Err.Description
Resume Exit_ProductoID_AfterUpdate
End Sub
I have copy this code and modified it from the Northwind database. Its a code that looks up the value of the UnitPrice field from the Products Table and puts this value on the UnitPrice field on the Orders Subform. All I chnaged was the field name and the table name but I get this messege when I try it:
The expression you entered as a query parameter produced this Error: 'The object does'nt contain the Anomation object "Fri."
I looked at all the fields used om my database, and compare them with the Northwind, the only difference is that am using a text field instead of a Autonumber for ProductID, the rest is the same.
What do I need to change? I attached a copy of my DB so you can see my problem.
Private Sub ProductoID_AfterUpdate()
On Error GoTo Err_ProductoID_AfterUpdate
Dim Filter As Currency
' Evaluate filter before it's passed to DLookup function.
Filter = "ProductoID = " & Me!ProductoID
' Look up product's unit price and assign it to UnitPrice control.
Me!Precio = DLookup("Precio", "Productos", Filter)
Exit_ProductoID_AfterUpdate:
Exit Sub
Err_ProductoID_AfterUpdate:
MsgBox Err.Description
Resume Exit_ProductoID_AfterUpdate
End Sub