Re: Tracking Use of Reports
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Sat, 2 Sep 2006 19:11:41 +0800
To use Execute instead of RunSQL or OpenQuery, you need to concatenate the
values into the string, e.g.:
strSql = "INSERT INTO ReportUsage ( UsageID, ReportName, ReportFilter1,
ReportFilter2, ReportDateTime, ReportUser ) SELECT """ & Me.[UsageID] & """
AS Expr1, """ & Me.[ReportName] & """ AS Expr2, ...
More info:
Action queries: suppressing dialogs, while knowing results
at:
http://allenbrowne.com/ser-60.html
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"naigy via AccessMonster.com" <u17625@uwe> wrote in message
news:65af9cb71a8f0@xxxxxx
Possibly an easier question. I have got that query to work properly now
but
only when the Docmd.OpenQuery command is used. Is there a way to surpress
confirmation prompting without changing the global setting in access or
the
database or is this a bad idea. Many Thanks.
naigy wrote:
Thanks Allen. I have followed your example from what I can see but I have
a
few problems. Firstly here is my OpenReport Click code.
Private Sub Openrpt_Click()
DoCmd.OpenReport Me.RptList.Value, acViewPreview
Dim strSql As String
strSql = "INSERT INTO ReportUsage ( UsageID, ReportName, ReportFilter1,
ReportFilter2, ReportDateTime, ReportUser ) SELECT [UsageID] AS Expr1,
[ReportName] AS Expr2, [ReportFilter1] AS Expr3, [ReportFilter2] AS Expr4,
[ReportDateTime] AS Expr5, [ReportUser] AS Expr6;"
DBEngine(0)(0).Execute strSql, dbFailOnError
End Sub
Now when I run this I get a Runtime 3061 error and it says "Too few
parameters. Expected 6". I was wondering where in the append / sql code I
input what I want the values to be. Ie Me.RptList.Value for ReportName &
ReportFilter1 as Me.DateFrom.Value.
Thanks for your assistance to get to this stage.
So you have a form where the user selects the report they want, enters[quoted text clipped - 34 lines]
any
criteria, and clicks a button to open the report, and you want to log
this.
(not
new records) also with a similar format.
.
- Follow-Ups:
- Re: Tracking Use of Reports
- From: naigy via AccessMonster.com
- Re: Tracking Use of Reports
- References:
- Tracking Use of Reports
- From: naigy via AccessMonster.com
- Re: Tracking Use of Reports
- From: Allen Browne
- Re: Tracking Use of Reports
- From: naigy via AccessMonster.com
- Re: Tracking Use of Reports
- From: naigy via AccessMonster.com
- Tracking Use of Reports
- Prev by Date: Re: Tracking Use of Reports
- Next by Date: Re: printing report showing a range of time
- Previous by thread: Re: Tracking Use of Reports
- Next by thread: Re: Tracking Use of Reports
- Index(es):