Kamis, 13 Agustus 2015

[MS_AccessPros] Re: DLookup

 

John,

Still getting error message.

Khalid


---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Khalid-

Looks like an extra single quote.  Try this:

    varPrice = DLookup("PricePerPiece", "ProductForClaimPerPiece",  _
        " AND Product = '" & Me.cboProduct & "'")

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Aug 13, 2015, at 7:25 AM, Khalid Tanweer khalidtanweerburrah@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

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: khalidtanweerburrah@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (32)

.

__,_._,___

Tidak ada komentar:

Posting Komentar