Syntax error with function

A

Alain

Hi to All,

I am trying to use the Dlookup function in Access but getting error syntax
in the condition segment, here is my line of code:
vomt = DLookup(arg, "Budget", "[idbranch]=" & num & " And ""[variante]=" &
var)

I would like to know if it is possible to use more than one condition in
this function, if so then how can I code it properly

Thanks in advance for the help

Alain
 
M

Marshall Barton

Alain said:
I am trying to use the Dlookup function in Access but getting error syntax
in the condition segment, here is my line of code:
vomt = DLookup(arg, "Budget", "[idbranch]=" & num & " And ""[variante]=" &
var)

I would like to know if it is possible to use more than one condition in
this function, if so then how can I code it properly
As far as I can see, you have some extra or missing quotes.

If variante is a numeric type field:
. . ., "[idbranch]=" & num & " And [variante]=" & var)

If it's a text field:
. . ., "[idbranch]=" & num & " And [variante]=""" & var &
"""")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top