Application not closing

G

Guest

Hi all,
I have created a form in Access that is completely working
on code, that is, without doing any settings in Access. I
started the new form with the Design View and not the
wizard. After I open this form, I cannot close my
Application. Why is this so? Can anybody help me please?
I have given the code in the Load event of the form as
follows:

Set db = CurrentDb
Set rs = db.OpenRecordset("Main Table", dbOpenDynaset)

and the Unload event as follows:

rs.Close

Please help me fix the error.
Thanks.
 
D

Dan Artuso

Hi,
After your close statement, try this as well:
Set rs = Nothing
Set db = Nothing
 
G

Guest

Hi Dan,
I added the two lines to the Unload event. Still it's the
same. What could be wrong?
Please help.
Thanks.
 
A

Andy

I have had this problem too. Something is still being left 'open'.

1. Make sure that all recordsets are closed and set to nothing within their
reference.
2. Do the same for all querydefs
3. For boolean usage, use 'If blTest = True' versus 'If blTest'

Good Luck,
Andy
 

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