Hello All, any help would be appreciated:
I am trying to pass a parameter to an Access Report. Just runningthe report from .net with no parameter in my access query and nowhereconditio n clause in my .net ...report prints correctly.
As soon as I add the parameter to my Access query, and thewhereconditi on to my .net....the .Net form pop's up a parameterbox for the user to enter the parameter. That's not what I want,I want to pass the text field automatically. I'm thinking it'sa syntax thing, but am having no luck finding an example:
Private Sub Button1_Click(B yVal sender As System.Object,B yVal e As System.EventArg s) Handles Button1.Click
Me.txtUKey.Text = 112 'just a test number to pass
Dim oAccess As Access.Applicat ion
oAccess = New Access.Applicat ionClass()
oAccess.OpenCur rentDatabase(fi lepath:="c:\Ine tpub\wwwroot\tr ibalastprgs\Ast PrgData.mdb", exclusive:=Fals e)
oAccess.DoCmd.O penReport(Repor tName:="HCSPRpt ",View:=Access. AcView.acViewNo rmal, _
wherecondition: ="[ukey]=" & Me.txtUKey.Text )
Thanks!! I appreciate any help you send my way. Elle
--------------------------------
From: Elle Short
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>TMliX8gi7kK smye541escQ==</Id>
I am trying to pass a parameter to an Access Report. Just runningthe report from .net with no parameter in my access query and nowhereconditio n clause in my .net ...report prints correctly.
As soon as I add the parameter to my Access query, and thewhereconditi on to my .net....the .Net form pop's up a parameterbox for the user to enter the parameter. That's not what I want,I want to pass the text field automatically. I'm thinking it'sa syntax thing, but am having no luck finding an example:
Private Sub Button1_Click(B yVal sender As System.Object,B yVal e As System.EventArg s) Handles Button1.Click
Me.txtUKey.Text = 112 'just a test number to pass
Dim oAccess As Access.Applicat ion
oAccess = New Access.Applicat ionClass()
oAccess.OpenCur rentDatabase(fi lepath:="c:\Ine tpub\wwwroot\tr ibalastprgs\Ast PrgData.mdb", exclusive:=Fals e)
oAccess.DoCmd.O penReport(Repor tName:="HCSPRpt ",View:=Access. AcView.acViewNo rmal, _
wherecondition: ="[ukey]=" & Me.txtUKey.Text )
Thanks!! I appreciate any help you send my way. Elle
--------------------------------
From: Elle Short
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>TMliX8gi7kK smye541escQ==</Id>
Comment