Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Format text within text


Message #1 by "Howard Stone" <ququmber@h...> on Tue, 19 Feb 2002 02:19:36
I have a form in which the OnLoad event opens a report.  The form has a

combo box whose values  serves as the criterion in a parameter query.  When

a selection is made  in the combo box the AfterUpdate event opens the

report and it is populate it according to the dictates of the value in the

combo box.  The form also have a cmdButtom called cmdPrint whose visible

property is set to false when the form loads.



The screen is set up so that the form and the report are both visible to

the user.  I want to use the OnClick event of another command button on the

form to print the report but cant figure out how.  I tried the DoCmd object

but the parameters do not offer a selection such as acReport, the

RunCommand does not help.



I know I could print from the menu on the report but I want to print from

the form since the user is already using the form to make selection from

the combo box.



How can I print the report from a cmdButton on the form.
Message #2 by joe.dunn@c... on Tue, 19 Feb 2002 09:40:44 +0000

I open the dialog form - i.e. a form set to pop-up and modal with dialog

border -from say a button on a menu form, with a control or controls to

allow the input of variables and OK and Cancel buttons.



The Cancel button just closes the dialog form.



The OK button does the following:

   hides the dialog form (not essential)

   opens the report taking the variables from the hidden dialog form as

   criteria for the select query underlying the report and prints the

   report

   closes the hidden dialog form



the calling menu form then gets the focus



if done from a macro the commands are:



SetValue  (with parameters item = [visible], expression = no)     i.e. hide

current form

Openreport     (with parameters reportname = xyzreport, view = print)  i.e.

print report

Close          (with parameters objecttype = form, objectname = xyxform,

save = prompt)  i.e. close dialog form



if done from code the commands are:



Private Sub btnOK_Click()

  Me.Visible = False

  DoCmd.OpenReport "xyzreport", acViewNormal

  DoCmd.Close acForm, "xyzform", acSavePrompt

End Sub



This gives me a consistent approach for opening reports or forms showing a

selection of data according to criteria selected in a dialog form. It also

allows me to tell the users what will happen when they click OK and to give

them a graceful exit if they have chosen the wrong option - which does

happen!



Joe Dunn







                                                                                         

                    "Howard                                                              

                    Stone"               To:     "Access" <access@p...>          

                    <ququmber@h...        cc:                                             

                    mail.com>            Subject:     [access] Format text within text   

                                                                                         

                    19/02/2002                                                           

                    02:19                                                                

                    Please                                                               

                    respond to                                                           

                    "Access"                                                             

                                                                                         

                                                                                         









I have a form in which the OnLoad event opens a report.  The form has a

combo box whose values  serves as the criterion in a parameter query.  When

a selection is made  in the combo box the AfterUpdate event opens the

report and it is populate it according to the dictates of the value in the

combo box.  The form also have a cmdButtom called cmdPrint whose visible

property is set to false when the form loads.



The screen is set up so that the form and the report are both visible to

the user.  I want to use the OnClick event of another command button on the

form to print the report but cant figure out how.  I tried the DoCmd object

but the parameters do not offer a selection such as acReport, the

RunCommand does not help.



I know I could print from the menu on the report but I want to print from

the form since the user is already using the form to make selection from

the combo box.



How can I print the report from a cmdButton on the form.










*************************************************************************



This e-mail may contain confidential information or be privileged. It is intended to be read and used only by the named
recipient(s). If you are not the intended recipient(s) please notify us immediately so that we can make arrangements for its return:
you should not disclose the contents of this e-mail to any other person, or take any copies. Unless stated otherwise by an
authorised individual, nothing contained in this e-mail is intended to create binding legal obligations between us and opinions
expressed are those of the individual author.



The CIS marketing group, which is regulated for Investment Business by the Financial Services Authority, includes:

Co-operative Insurance Society Limited Registered in England number 3615R - for life assurance and pensions

CIS Unit Managers Limited Registered in England and Wales number 2369965  - for unit trusts and PEPs

CIS Policyholder Services Limited Registered in England and Wales number 3390839 - for ISAs and investment products bearing the CIS
name

Registered offices: Miller Street, Manchester M60 0AL   Telephone  0161-832-8686   Internet  http://www.cis.co.uk   E-mail
cis@c...



CIS Deposit and Instant Access Savings Accounts are held with The Co-operative Bank p.l.c., registered in England and Wales number
990937, P.O. Box 101, 1 Balloon Street, Manchester M60 4EP, and administered by CIS Policyholder Services Limited as agent of the
Bank.



CIS is a member of the General Insurance Standards Council



CIS & the CIS logo (R) Co-operative Insurance Society Limited



********************************************************************************


  Return to Index