lost focus ?

  • Thread starter Thread starter Dirk
  • Start date Start date
D

Dirk

Hi all,

In a module I programmed the following code :

sub PrintLetter
dim db as dao.database,...,rst as recordset, ...

If rst.RecordCount = 0 Then
AutomaticLetter = False
Exit Function
Else
Do While Not rst.EOF
strCourseId = rst.Fields("Id")
GenerateInvoice strCourseId
rst.MoveNext
Loop
End If

The procedure GenerateInvoice works fine, when called from
a form, but, I now get error 3420 "object no longer
referenced". The recordset rst is local, defined in this
particular procedure.

strCourseId contains the perfect value, the procedure
GenerateInvoice does what I want it to do. Before I
arrive at the GenerateInvoice call, my recordset exists
and contains the records I want. However after returning
from the procedure GenerateInvoice , where I call a local
recordset rst as well, it no longer exists in the calling
procedure ?

Any help would be mostly appreciated.
 
You need to post the entire code, including where you set the rst variable
in what you've already posted, and the subroutine GenerateInvoice.
 
Hi,
In a module I programmed the following code
The procedure GenerateInvoice works fine,
when called from a form, but, I now get error
3420 "object no longer referenced".

Just a guess based on the limited information: If your GenerateInvoice
procedure is within a form, then the PrintLetter procedure can no longer
find it.
 
Back
Top