returning a value from a form

  • Thread starter Thread starter oldguy
  • Start date Start date
O

oldguy

Using Access 2002 on WinXP.

In one of the event procedures of Form1, I'm opening Form2, which has a
Print button which opens a report (if the user clicks a button) which must
be printed for the operation to continue.

It's possible to return from Form2 without opening the report.

I want to be able to determine whether the report is printed or not.

I could not find anywhere (well, in the help, or on the Internet) which
tells me if it's possible to return a value (a boolean or an integer or a
string) from a report and/or form, and if yes, how.

Any hint will be sufficient (I hope), and will be warmly welcome.

Engin.
 
Engin

I've seen similar requests before, but don't think I've ever seen a
"solution." Here's a couple reasons why...

You send a <print> to the printer, but the printer is out of
paper/ink/... -- is your printer smart enough to know that it didn't print,
and can it tell your PC?

You send a <print> to the printer and it "grabs" three sheets of paper
(humidity must be up today) and spreads your print page across all three.
Even if you printer is smart enough to know that it DID print and can tell
your PC, and your PC can tell Access, you still didn't get what you wanted,
right?!

The kinds of solutions I've seen here involve adding code to ask the USER if
s/he got printed what s/he wanted, then using that answer to indicate
"successful printing".
 
Hi Jeff,

Many thanks for your reply. You're totally right in saying that there is
absolutely no way to ensure that the print action was *completed*
successfully. I was thinking of *forcing* the operator to take (at least to
try to) a printout. I assumed that, once the print job is started by the
operator, he/she will take it as a personal challenge to finish the print
job in the case of a misfeed, etc (straight psychology which works in a
majority of cases), and a retry will be made ( I have provided the means).

Anyway, I can see that this is quite difficult and unsure to maintain for
printouts, and I will try to use the method you have described. On the other
hand, is there a chance to return a value from a form when it's closed?
Currently I'm using a field on a table as a semaphore to pass result
information between forms, and although it works, it does not look like a
proper solution.

Best wishes,

Engin
 
Engin

If I'm interpreting correctly, you are describing using a field value as a
"flag", to let your application know something happened. Another way you
can do that is to declare a global variable in a module, and set the value
of that variable -- however, this only works while "in session". Once you
shut down the application, you lose the variable value.
 
Back
Top