about generation of data report

vba Argentina
  • 12 years ago

    I facing a problem when I am going to generate a data report in the vb.

    I want to generate a data report in vb according the date provided by me.

    In two text boxes I am giving the from date and to date, then I want the report

    by clicking the vewreport comand button.

    I am new in vb so please help me to doing this.

  • 12 years ago

    Form = frmReport
    Textbox name = txtFromDate 

    Create a button & paste in this code


    Dim sFromDate As String
    sFromDate = Form_frmReport.txtFromDate

    ' Preview the report and pass in the values
    ' fromDate is the feild name from the table (or Query)

        Dim stDocName As String
        stDocName = "Report"

    DoCmd.OpenReport stDocName, acViewPreview, , "fromDate = " & sFromDate

     

     

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“An idiot with a computer is a faster, better idiot” - Rich Julius