Generating/Invoking "Report Wizard"

  • Thread starter Thread starter vikash.verma
  • Start date Start date
V

vikash.verma

Hi All,
I am trying to generate a Report based on on the User Defined Report created
by the User. I need to Invoke the "Report Wizard" and proceed ahead as
generally it happns in wizard.But i need to call this Wizard through my
Form/Button.How to proceed...........
Is there any code or any Fn i need to call ??????

If any one knows abt it then please let me know how to proceed ahead.Any
link or code which can give me an idea about it.

Thanks and Regards
Vikash
 
Hello,

When I use the following in Access 2002

DoCmd.RunCommand acCmdNewObjectReport

This will automatically start the wizard for a new report. Note if the user
cancels then an error occurs. You could code around this and the full sub
would look something like:

Private Sub cmdNewReport_Click()
On Error Goto Err_cmdNewReport_Click

' Open a new report
DoCmd.RunCommand acCmdNewObjectReport

Exit_cmdNewReport_Click:
' Exit normally
Exit Sub

Err_cmdNewReport_Click:
' Check which error has occured
Select Case Err
Case 2501 ' The run command action was canceled
' Exit the sub
Resume Exit_cmdNewReport_Click
Case Else
' Inform the user of the error
MsgBox Err.Description & vbNewLine & vbNewLine &
"(cmdNewReport_Click)" _
, vbOKOnly+vbCritical, "Error: " & Err
' Exit the sub
Resume Exit_cmdNewReport_Click
End Select

End Sub

In this example, the name of my button to create a new report was named
cmdNewReport.

HTH,

Neil.
 
Hi Neil,
Yes this works, but my requirment was Report Wizard starting from the 2nd
Page
So i have added this fn nd it works well ithout any error related to cancel
button.

Function On_Click()
Dim tmpvar As Variant
tmpvar = Application.Run("acwzmain.frui_entry", "Report", acReport)
End Function

But i am not able to give Title Name.I want to replace the "Report Wizard"
caption with some different name.I am trying to add it inside the arg. but
it doesnt work.???Any idea how to do that.

Thanks again,
Vikash
 
ah well,

That is slightly more difficult :-)

I know that there is no way of changing this in your code, but i do not know
if you can change it passing an additional argument into the Run function...
MVP required i think :-)

Good luck,

Neil.
 
Back
Top