Creating Access Report based on the Value passed from VB

  • Thread starter Thread starter Sudhakara.T.P.
  • Start date Start date
S

Sudhakara.T.P.

Hi,
I have a form in VB where I have a text box to enter the
Report Name to be created. Once I enter a name for the
Report and click on Create, then I should be able to
create a new report in Ms-Access with the name entered in
the text box.
Could anyone help me on this, as I am not able to pass
this value from VB to Access.
Expecting a positive and a early reply

Regards
Sudhakara.T.P.
 
Add a table to your mdb that has one record and one field. Set the value
from VB and use it in Access. I don't know how you are intending to "create"
a report. Do you mean open an existing report?
 
Use openarg!

The code in Access is:
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)

Me!strTitle = Me.OpenArgs
End Sub
to move the value passed in openargs to a textbox.

This is the VB code to open the report:
acAppXP.DoCmd.OpenReport xReport, xAcView, , xstr, acWindowNormal, xTitle
where xtitle is the string that is passed to openargs.
Candy
 
Back
Top