Re: Code error is null
- From: "dbl" <bobline@xxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Jun 2005 17:17:05 +0100
Klatuu its a text field with the following as the control source
=Age([LicHeldDate])
LicHeldDate is a Date/Time field
Does that help?
Bob
"Klatuu" <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B3E01645-5010-4F8A-B0A3-36476A2397E5@xxxxxxxxxxxxxxxx
>I need to know what age() is. Is it a user defined function? can you post
> the code for it?
>
> "dbl" wrote:
>
>> Klatuu sorry if there is no data in field LicHeldDate (because we do not
>> know when the driver passed the test or there is not a driver allocated
>> to a
>> vehicle).
>>
>> Text503 returns 0 (I though it was picking up a null blank cell but its
>> not)
>>
>> Text503 has the following control source =Age([LicHeldDate])
>>
>> So the code picks up the <1 part of the Excess "Novice25Plus" (Which is
>> wrong if there is no driver allocated to a vehicle or no date in
>> LicHeldFor)
>>
>> But if the driver has held a licence for less than a full year Text503
>> returns 0 so how do I get Text503 to be null if there is no data in Field
>> LicHeldDate? Because this is the only way I can see that it will work
>> correctly with the amended code you have just posted. Or is there a
>> better
>> way round the problem.
>>
>> Thanks for your help
>>
>> Bob
>>
>>
>>
>> "Klatuu" <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:64CB0AF1-7D5F-4757-AFFF-6BBA471F8143@xxxxxxxxxxxxxxxx
>> >I have not tested this, but I think it will do the trick. I return 99
>> >in
>> >the
>> > Nz() function so that a Null value will translate to a value larger
>> > than
>> > you
>> > are checking for.
>> >
>> > ed = DLookup(strLookup, "qryCheckRecSent", crit)
>> > If Nz(Me.Text503,99) < 1 And Me.ExAge >= 25 Then
>> > ed = ed + DLookup("[Novice25Plus]", "qryCheckRecSent", crit)
>> > End If
>> >
>> > "dbl" wrote:
>> >
>> >> Hi I have the following code which I need to work out how to tell it
>> >> if
>> >> Text503 is null then to ignore this part of the code
>> >>
>> >> If Me.ExAge >= 25 And Me.Text503 <1 Then
>> >> ed = ed + DLookup("[Novice25Plus]", "qryCheckRecSent",
>> >> crit)
>> >> End If
>> >>
>> >> I have tried different ways but all produce the following error
>> >> Compile
>> >> Error Expected Expression
>> >> this is what I have done, how do I put it right?
>> >>
>> >> ed = DLookup(strLookup, "qryCheckRecSent", crit)
>> >> If Me.ExAge >= 25 And Me.Text503 Is Not Null And <1 Then
>> >> ed = ed + DLookup("[Novice25Plus]", "qryCheckRecSent",
>> >> crit)
>> >> End If
>> >>
>> >> Any help would be very much appreciated.
>> >>
>> >> Bob
>> >>
>> >>
>> >>
>>
>>
>>
.
- Follow-Ups:
- Re: Code error is null
- From: Klatuu
- Re: Code error is null
- References:
- Code error is null
- From: dbl
- RE: Code error is null
- From: Klatuu
- Re: Code error is null
- From: dbl
- Re: Code error is null
- From: Klatuu
- Code error is null
- Prev by Date: Re: Read Only - DB
- Next by Date: copy data from a record to a new record
- Previous by thread: Re: Code error is null
- Next by thread: Re: Code error is null
- Index(es):