Re: Multiple conditions in DLookUp
- From: MStressed <MStressed@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 25 May 2005 05:56:01 -0700
Thanks guys! It works as expected. It still works even without the space
before the word And. That helps out a lot, the only thing is that I have to
evaluate against three conditions. They are: "Product Type", "Length equal
to" and "Length less than".
My statement is as such: DLookup("[fieldName]", "Table1", "[fieldName]=" &
[Table2]![fieldName] & "And [fieldName2]=" & [Table2]![fieldName2])
I want to somehow add a check for [fieldName2]>[Table2]![fieldName2].
I tried - DLookup("[fieldName]", "Table1", "[fieldName]=" &
[Table2]![fieldName] & "And [fieldName2]=" & [Table2]![fieldName2] And "And
[fieldName3]>" & [Table2]![fieldName2])
This syntax is my problem, I'm sure. Thanks again.
"Ofer" wrote:
> Tanks John I noticed that, but I thought they will notice that, thanks for
> replaying.
> Also incase the criteria is with date then we should add the Hash letter
> before and after
>
> DLookUp("[fieldName]","Table1","[fieldName]=#" & [Table2]![fieldName]
> & "# And [fieldName2]>#" & [Table2]![fieldName2] & "#")
>
>
>
> "John Vinson" wrote:
>
> > On Tue, 24 May 2005 12:32:04 -0700, "Ofer"
> > <Ofer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > >Try that
> > >
> > >DLookUp("[fieldName]","Table1","[fieldName]=" & [Table2]![fieldName] & "And
> > >[fieldName2]>" & [Table2]![fieldName2])
> >
> > One tiny tweak: you need a blank before the word And:
> >
> > DLookUp("[fieldName]","Table1","[fieldName]=" & [Table2]![fieldName] &
> > " And [fieldName2]>" & [Table2]![fieldName2])
> >
> > In addition, if either Fieldname1 or Fieldname2 is of Text type, you
> > need the syntactically required quotemarks:
> >
> > DLookUp("[fieldName]","Table1","[fieldName]='" & [Table2]![fieldName]
> > & "' And [fieldName2]>'" & [Table2]![fieldName2] & "'")
> >
> >
> > John W. Vinson[MVP]
> >
> >
> >
.
- Follow-Ups:
- Re: Multiple conditions in DLookUp
- From: Ofer
- Re: Multiple conditions in DLookUp
- From: Ofer
- Re: Multiple conditions in DLookUp
- References:
- Multiple conditions in DLookUp
- From: MStressed
- RE: Multiple conditions in DLookUp
- From: Ofer
- Re: Multiple conditions in DLookUp
- From: John Vinson
- Re: Multiple conditions in DLookUp
- From: Ofer
- Multiple conditions in DLookUp
- Prev by Date: Re: Format a date field in query result
- Next by Date: How to extract latest record
- Previous by thread: Re: Multiple conditions in DLookUp
- Next by thread: Re: Multiple conditions in DLookUp
- Index(es):
Relevant Pages
|