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) >> >> >> > >
|