Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / July 2006

Tip: Looking for answers? Try searching our database.

Why "no current record" on a DLookup function?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Laurel - 29 Jul 2006 01:33 GMT
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)
Douglas J. Steele - 29 Jul 2006 13:39 GMT
What is "ai_StudentID"?

Signature

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

> This is the first line of a function that I execute repeatedly throughout
> my
[quoted text clipped - 9 lines]
>    ls_firstname = DLookup("First_Name", "tblStudents", "[student_id] = " &
> ai_StudentID)
Laurel - 29 Jul 2006 15:56 GMT
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.

> What is "ai_StudentID"?
>
[quoted text clipped - 12 lines]
>> &
>> ai_StudentID)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.