Group:  Microsoft Access ยป microsoft.public.access.gettingstarted
Thread: Why "no current record" on a DLookup function?

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Why "no current record" on a DLookup function?
"Laurel" <FakeMail[ at ]Hotmail.com> 29.07.2006 00:33:03
This is the first line of a function that I execute repeatedly throughout my
app. But now I have a situation where it is giving me a "no current record"
error. How could that be with this line? The context is that I have a form
that collects data and then opens a report. If I close the report and then
re-execute the form, to print another report, I get the "No current
record..." error at this line. I'm mystified. Will appreciate any help.

ls_firstname = DLookup("First_Name", "tblStudents", "[student_id] = " &
ai_StudentID)



Re: Why "no current record" on a DLookup function?
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> 29.07.2006 12:39:59
What is "ai_StudentID"?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Laurel" <FakeMail[ at ]Hotmail.com> wrote in message
news:OHXh3ZqsGHA.4992[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text]
> This is the first line of a function that I execute repeatedly throughout
> my
> app. But now I have a situation where it is giving me a "no current
> record"
> error. How could that be with this line? The context is that I have a
> form
> that collects data and then opens a report. If I close the report and
> then
> re-execute the form, to print another report, I get the "No current
> record..." error at this line. I'm mystified. Will appreciate any help.
>
> ls_firstname = DLookup("First_Name", "tblStudents", "[student_id] = " &
> ai_StudentID)
>
>
>


Re: Why "no current record" on a DLookup function?
"Laurel" <FakeMail[ at ]Hotmail.com> 29.07.2006 14:56:10
That was it. The function was being called by the report. I had this in
one of the header text items: =fncStudentName([student_id]).
The second time I ran the report I was adding the current day, and so there
were no records for the report. I'll add a check.

The truly weird thing, though, was that even when I hovered over ai_student
with the mouse in the debugger, I would get that "no current record" error.
You'd think the function would just treat it as a null. How did it know why
the value wasn't good???

Thanks for helping me see the obvious.

"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> wrote in message
news:Or%23cYwwsGHA.1216[ at ]TK2MSFTNGP03.phx.gbl...
[Quoted Text]
> What is "ai_StudentID"?
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Laurel" <FakeMail[ at ]Hotmail.com> wrote in message
> news:OHXh3ZqsGHA.4992[ at ]TK2MSFTNGP02.phx.gbl...
>> This is the first line of a function that I execute repeatedly throughout
>> my
>> app. But now I have a situation where it is giving me a "no current
>> record"
>> error. How could that be with this line? The context is that I have a
>> form
>> that collects data and then opens a report. If I close the report and
>> then
>> re-execute the form, to print another report, I get the "No current
>> record..." error at this line. I'm mystified. Will appreciate any help.
>>
>> ls_firstname = DLookup("First_Name", "tblStudents", "[student_id] = "
>> &
>> ai_StudentID)
>>
>>
>>
>
>



Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net