Field default value on form from another table

lim.merlin

New member
Local time
Today, 15:21
Joined
Jun 10, 2013
Messages
3
Hello,

I have 2 tables: Product and Sales
In table Product, I have field "Product" and "Price"
In table Sales, I have field "Product" and "@ Price"

And there is form "Sales" which is based on table "Sales"

I would like to make "Price" the default value of "@ Price" where "Product" on form Sales = "Product" from table Product

I put in the following expression in the "After Update" event of Product on form Sales:
Private Sub Product_AfterUpdate()
Me.@Price.DefaultValue = DLookup("Price", "Product", "Product=" & Product)
End Sub

However, it keeps giving me this error:
Run time error '3075'
Syntax error (missing operator) in query expression 'Produk=abc'.

Can anyone help?

Cheers.
 
Perfect, this is it.

Thank you so much, Paul.
 

Users who are viewing this thread

Back
Top Bottom