Problem with "OnClose"

T

TommoUK

I have what should be, a simple problem to solve but I am banging my head at
the moment!!

I have a routine that runs and once finished, opens up a form (in datasheet
mode). The user can then check the data and add or amend if required. I have
set the "OnClose" event of this form to call a function (through an embedded
macro) that outputs the table behind the form to Excel. If I run this
function on it's own, it works fine. If I run through the whole procedure and
then close Access, it also works fine. However, if I simply close the form,
the function to output the table is not being called.

Help!!!!!!!!!
 
B

banem2

I have what should be, a simple problem to solve but I am banging my headat
the moment!!

I have a routine that runs and once finished, opens up a form (in datasheet
mode). The user can then check the data and add or amend if required. I have
set the "OnClose" event of this form to call a function (through an embedded
macro) that outputs the table behind the form to Excel. If I run this
function on it's own, it works fine. If I run through the whole procedureand
then close Access, it also works fine. However, if I simply close the form,
the function to output the table is not being called.

Help!!!!!!!!!

Hi,

Place a breakpoint to line where you call macro. You can stop the
program at that moment and run macro manually. Looks like, at the
moment you call macro, something is wrong with data it should output
or it might be something similar.

Regards,
Branislav Mihaljev
Microsoft Access MVP
 

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