Rabu, 12 Agustus 2015

[MS_AccessPros] DLookup

 

Hi John,
            I hope you & all group members would be fine.

Previously you told me how to use DLookup to get Rate
    Dim varRate As Variant
    varRate = DLookup("DestinationRate", "tblDestinationRates", _
        "Destination = '" & Me.cmbDestination & _
        "' AND ProductNameEnglish = '" & Me.ProductNameEnglish & "'")
    Me.Rate = Nz(varRate, 0)

Now i am trying to get PricePerPiece on a different Form but getting error, i have tried last night but could not get it. On the following code i receive message 
Run-time error '3075':
Syntax error (missing operator) in query expression "AND Product =
'XXXXXXX".

Private Sub cmbPricePerPiece_GotFocus()
    Dim varPrice As Variant
  
    varPrice = DLookup("PricePerPiece", "ProductForClaimPerPiece", _
        "' AND Product = '" & Me.cboProduct & "'")
    Me.PricePerPc = Nz(varPrice, 0)
End Sub

What i am doing wrong cannot understand. Help needed please.

Regards,
Khalid

__._,_.___

Posted by: Khalid Tanweer <khalidtanweerburrah@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (30)

.

__,_._,___

Tidak ada komentar:

Posting Komentar