R
Raul Sousa
I have the following code on a form:
Form_Close
Link = "[DocId] = """ & Me.[DocId] & """"
DoCmd.OpenReport "Detail", acViewPreview, , Link, acNormal
And, this in its subform:
Code_Afterupdate
Me.Name = DLookup("Name", "Products", Me.[ProductCode] = [ProductCode])
Me.Price = DLookup("SalePrice", "SalePrice", ProductCode = Me. ProductCode)
The problem is that no matter which ProductCode I have on the subform the
function always returns the Name and SalePrice of the first record on
Products and SalePrice tables.
And the same goes for the form
No matter which DocId I have on the form it always opens the Report on the
first record on Documents tables.
There must be some problem in this code but I cant figure it out.
So, I appreciate any help you can give me.
Form_Close
Link = "[DocId] = """ & Me.[DocId] & """"
DoCmd.OpenReport "Detail", acViewPreview, , Link, acNormal
And, this in its subform:
Code_Afterupdate
Me.Name = DLookup("Name", "Products", Me.[ProductCode] = [ProductCode])
Me.Price = DLookup("SalePrice", "SalePrice", ProductCode = Me. ProductCode)
The problem is that no matter which ProductCode I have on the subform the
function always returns the Name and SalePrice of the first record on
Products and SalePrice tables.
And the same goes for the form
No matter which DocId I have on the form it always opens the Report on the
first record on Documents tables.
There must be some problem in this code but I cant figure it out.
So, I appreciate any help you can give me.