C
CJ
Hi Groupies:
I have a dlookup on a continuous subform. It appears to be searching with
the correct value but it is returning the lookup value from the first record
in the table.
What I am getting is this:
1111 Product 1 $25
3333 Product 2 $25 (Product 2 should be $17.50, not $25)
8888 Product 3 $25 (Product 3 should be $45, not $25)
My code is as follows:
Private Sub SKU_Number_AfterUpdate()
On Error GoTo Err_SKU_Number_AfterUpdate
Dim strFilter As String
strFilter = "[SKU_Number]=""" & Me.[SKU_Number] & """"
Debug.Print strFilter (I added this so I could confirm that it is
finding the correct SKU_Number, it is.)
Me.Price = DLookup("curRate", "tblInventory", strFilter)
Exit_SKU_Number_AfterUpdate:
Exit Sub
Err_SKU_Number_AfterUpdate:
MsgBox ("Problem")
Resume Exit_SKU_Number_AfterUpdate
End Sub
Can somebody please help me solve this problem!!
I have a dlookup on a continuous subform. It appears to be searching with
the correct value but it is returning the lookup value from the first record
in the table.
What I am getting is this:
1111 Product 1 $25
3333 Product 2 $25 (Product 2 should be $17.50, not $25)
8888 Product 3 $25 (Product 3 should be $45, not $25)
My code is as follows:
Private Sub SKU_Number_AfterUpdate()
On Error GoTo Err_SKU_Number_AfterUpdate
Dim strFilter As String
strFilter = "[SKU_Number]=""" & Me.[SKU_Number] & """"
Debug.Print strFilter (I added this so I could confirm that it is
finding the correct SKU_Number, it is.)
Me.Price = DLookup("curRate", "tblInventory", strFilter)
Exit_SKU_Number_AfterUpdate:
Exit Sub
Err_SKU_Number_AfterUpdate:
MsgBox ("Problem")
Resume Exit_SKU_Number_AfterUpdate
End Sub
Can somebody please help me solve this problem!!