Re: Multiple conditions in DLookUp
- From: "Ofer" <Ofer@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 25 May 2005 07:37:07 -0700
You wrote the 'and' word twice. Instead of the first 'and' you should have
the '&' character.
DLookup("[fieldName]", "Table1", "[fieldName]=" &
[Table2]![fieldName] & "And [fieldName2]=" & [Table2]![fieldName2] & "And
[fieldName3]>" & [Table2]![fieldName2])
"MStressed" wrote:
> 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: MStressed
- 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
- Re: Multiple conditions in DLookUp
- From: MStressed
- Multiple conditions in DLookUp
- Prev by Date: Re: How to extract latest record
- Next by Date: Re: Advance question: Need to "cluster" records
- Previous by thread: Re: Multiple conditions in DLookUp
- Next by thread: Re: Multiple conditions in DLookUp
- Index(es):
Relevant Pages
|