lost focus ?

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.
 
K

Ken Snell

You need to post the entire code, including where you set the rst variable
in what you've already posted, and the subroutine GenerateInvoice.
 
C

CSmith

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top