Looking for the best way to do the following:

P

Parker

I have a switchboard form in Access 2000 and I want to add a button that does
the following:
#1 Preview a specified Report on screen
#2 On close of the Report, prompt / ask user if Report was ok
#3 If user indicates yes, Email the report to specified emails
#4 Propmt / ask user if Report was sent ok
#5 If user indicates yes, Run a specified Update Query
Note, if the user indicates No at any point, close out of this routine.
Also, I would like to hotkey 'Y" and 'N' in the user prompts if possible...

Any thoughts on how best to accomplish this?

I was thinking of making the button open a new form that OnOpen previews the
report and sets a variable (StepNo) to 1 and using OnActive to check the
StepNo and perform the appropriate action...

Thanks in advance for any help!

Parker
 
L

Larry Daugherty

Hi Parker,

The general rule is one issue per post . Your post is somewhat interesting
but rises to the level of "Will someone fix my life, I'm too busy".

As you may be aware, you can build a hierarchy of switchboards if it fits
your needs. At the level your post asks - "click a button on the
switchboard ...". You need to have designed your report already or at least
have a report of the name you intend to use in your Reports window. Name
your operation "Run Report ' .....' " and then choose the appropriate path
to open the report.

You might try working your way through some of your issues and see what you
can solve on your own - really, the idea of these newsgroups is that unpaid
volunteers give of their time and talents to solve a problem you couldn't
yet solve. The idea is never to save people the sweat of trying to become
self sufficient in developing with Access. If you just want people to
provide you with solutions with no effort on your part then I suggest you
advertise for an Access developer in your local market or in some of the
"Jobs" newsgroups.

HTH
 
P

Parker

Sorry about that, maybe I was unclear. My intent was not to have someone
'fix my life becuase I'm too busy'.

I have my Report written (RptBillingList) and can create a button to preview
the report, I have my Update Query written (QryUpdateBilling) and know how to
run it, I have figured out how to email my report in snapshot format to the
desired email accounts using DoCmd.SendObject.

I was just looking for some advice on how to get the proper timing and
sequence of the events (Again, my thought was to use a 'StepNo' variable) and
also how best to prompt the user (InputBox or a new Switchboard Form). Also,
I have had trouble with global variables in the past not carrying through
from one form to another.

I just thought someone could steer me in the right direction here before I
went too far down the wrong path. I will continue to try to figure it out on
my own.

I apologize for wasting your time.

Parker
 
L

Larry Daugherty

No apologies necessary.

It's up to you to make your application flow as you wish. You can put
microevents on the switchboards or you can limit it to implicit sequences.
Like all Windows applications, Access is inherently asynchronous. When you
spawn a new process, the current process keeps running. Maintaining
synchronism by timing is all but impossible. The solution is usually to put
the call to a new process in the terminal event of the current process.

Msgbox prompts will work just fine and have sample code for making choices.
I usually keep it simple with the msgboxes but believe there is a format
with vbYes and vbNo. You can choose which is the default. If you
absolutely need hotkey operation you may have to design your own prompting
form and command buttons.

You can put the code to call the msgbox in the OnClose event of the Report.
Same with the email function/form. Within the msgbox code you will initiate
any succeeding events.

You can certainly establish a table of steps and continually refer to it to
determine your next action. That concept is used implicitly in things like
callback functions but is not normally used to control simple flow issues.
I recommend against it.

For information about User Interface design, MS Press sells something on the
official Microsoft design goals and guidelines. Alan Cooper is an author
and presenter who makes a living informing us of things to do with interface
design.

HTH
 
Top