Results 1 to 7 of 7

Thread: Help !!!! Displaying The Parameterized Report

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Posts
    260

    Help !!!! Displaying The Parameterized Report

    Dear friends

    I have created a report from a parameter query in access. i want to open that report in the vb. i have opened the normal reports of access in vb but i do not know that how to open parmeterized report of access in vb. please help me in that matter



    regards

    shivpreet2k1

  2. #2
    Hyperactive Member eranfox's Avatar
    Join Date
    May 2001
    Posts
    492

    Re: Help !!!! Displaying The Parameterized Report

    Hello SHIVPREET2K1,

    VB Code:
    1. Dim appAccess As Access.Application
    2. Set appAccess = New Access.Application
    3.  
    4. appAccess.Visible = True
    5. appAccess.DoCmd.Maximize
    6.  
    7. appAccess.OpenCurrentDatabase "\\YOUR PATH GOES HERE\YOUR ACCESS DB.MDB"
    8. appAccess.DoCmd.Maximize
    9. appAccess.DoCmd.RunCommand acCmdWindowHide
    10. appAccess.DoCmd.OpenReport "YOUR REPORT",[Filter Name],[Where Condition], acViewPreview ' <- this is [Window Mode]

    Best Regards,
    ERAN
    Eran Fox
    ASSEMBLER,C,C++,VB6,SQL...

  3. #3
    Hyperactive Member eranfox's Avatar
    Join Date
    May 2001
    Posts
    492

    Re: Help !!!! Displaying The Parameterized Report

    Hello SHIVPREET2K1,
    I got your Message , i forgot to write that I didnt use a Parameterized Report
    But a Regular Report insted.

    I used the where condition with a string that the user build:

    VB Code:
    1. Dim strSelect As String
    2. strSelect = "[ID]=45080001"
    3. strSelect = strSelect & " AND [NAME]=" & cboName
    4. appAccess.DoCmd.OpenReport "Rpt1", acViewPreview, , strSelect

    you can let your user to enter values in comboboxes,textboxes,listboxes etc...

    I think you just cant display the Parameterized Report from VB
    Maybe i'm wrong,but i changed my Parameterized Report to a Regular select Report and used the Where condition.

    Best Regards,
    ERAN
    Eran Fox
    ASSEMBLER,C,C++,VB6,SQL...

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Posts
    260

    Thanks Eran and one more question

    Hi Eran

    Thanks for ur help

    But now let me know what is this select report and how i can create it in vb6.0.



    Thanks in advance

    Shivpreet2k1

  5. #5
    Hyperactive Member eranfox's Avatar
    Join Date
    May 2001
    Posts
    492

    Re: Help !!!! Displaying The Parameterized Report

    Hello SHIVPREET2K1,
    When i wrote "Select Report" i ment a regular SQL sentence for e.g:

    SELECT *
    FROM TABLE_NAME
    WHERE FIELD_NAME = SOMTHING

    Or much more simple:

    SELECT *
    FROM TABLE_NAME

    insted of parameterized query you will have the same query without asking for parameters, you will send the [Where Condition] from vb to access and you will get the same results.

    Best Regards,
    ERAN
    Eran Fox
    ASSEMBLER,C,C++,VB6,SQL...

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Posts
    260

    Re: Help !!!! Displaying The Parameterized Report

    Thanks for your reply but can u provide me a practical example of calling report through select query so that i may understand it clearly

  7. #7
    Hyperactive Member eranfox's Avatar
    Join Date
    May 2001
    Posts
    492

    Re: Help !!!! Displaying The Parameterized Report

    Hello SHIVPREET2K1,
    Here is a small example, i hope that will do!

    1)Place the biblio.mdb in C:\
    2)if you'll open the mdb you will see a query called "All Titles" as a base for "rptAuthors".
    3)from the vb program i call the "rptAuthors" with WHERE CONDITION.

    Best Regards,
    ERAN
    Attached Files Attached Files
    Last edited by eranfox; Sep 5th, 2005 at 05:08 PM. Reason: CANNOT ATTACH THE ZIP FILE
    Eran Fox
    ASSEMBLER,C,C++,VB6,SQL...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width