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
Re: Help !!!! Displaying The Parameterized Report
Hello SHIVPREET2K1,
VB Code:
Dim appAccess As Access.Application
Set appAccess = New Access.Application
appAccess.Visible = True
appAccess.DoCmd.Maximize
appAccess.OpenCurrentDatabase "\\YOUR PATH GOES HERE\YOUR ACCESS DB.MDB"
appAccess.DoCmd.Maximize
appAccess.DoCmd.RunCommand acCmdWindowHide
appAccess.DoCmd.OpenReport "YOUR REPORT",[Filter Name],[Where Condition], acViewPreview ' <- this is [Window Mode]
Best Regards,
ERAN
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:
Dim strSelect As String
strSelect = "[ID]=45080001"
strSelect = strSelect & " AND [NAME]=" & cboName
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
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
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
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
1 Attachment(s)
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