Re: Better Way?
- From: "SMac" <SMac@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 9 May 2005 13:15:33 -0700
Thanks for the time!
One question, when I complie I get "Compile Error: Syntax error" on line
If IsNull(DLookup("[Rate]", "tbl_Tonnage_Rate", StrCriteria) Then
Do you know why?
Thanks again!
Stacey
"Ronald W. Roberts" wrote:
> SMac wrote:
>
> >How would I write the DLookup?
> >Thanks!
> >
> >"1" wrote:
> >
> >
> >
> >>On Mon, 25 Apr 2005 08:51:01 -0700, "SMac"
> >><SMac@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> >>
> >>(snip)
> >>
> >>
> >>>It seems so easy in thought but to write code I am lost how to make 2
> >>>criterias before the "Then" section of an If-Then statement.
> >>>
> >>>Thanks!!
> >>>Stacey
> >>>
> >>>
> >>Im not sure why you need an If,Then for this, I would think its a
> >>straightforward Dlookup
> >>
> >>To answer the question:
> >>
> >>If (Condition1=True) and (condition2 = True) then Goto ...
> >>
> >>it could also be "or"
> >>
> >>
> >>
> >>
> This is air code, but it will be something like this.
>
> Dim MyRate As Currency
> Dim StrCriteria as String
>
> StrCriteria="Model_Year =" & Me!Model_Year
> StrCriteria = StrCriteria & " Tonnage_Start <=" & Me!Rate
> StrCriteria = strCriteria & " And Tonnage_Finish >=" & Me!Rate
> If IsNull(DLookup("[Rate]", "tbl_Tonnage_Rate", StrCriteria) Then
> MyRate = 0
> Else
> MyRate = DLookup("[Rate]", "tbl_Tonnage_Rate", StrCriteria)
> EndIF
>
> Me!Rate and Me!Model_Year are the control names on the form.
>
> Ron
>
> --
> Ronald W. Roberts
> Roberts Communication
> rwr@xxxxxxxxxx
>
>
.
- Follow-Ups:
- Re: Better Way?
- From: Dirk Goldgar
- Re: Better Way?
- Prev by Date: Problem linking two list boxes
- Next by Date: RE: Date Function
- Previous by thread: Problem linking two list boxes
- Next by thread: Re: Better Way?
- Index(es):
Relevant Pages
|