How to pass parameters to a report
I would modify the code in the command button like:
Dim strWhere as String
Dim strReportName as String
'assuming a numeric field named "MemberID"
strWhere = "[MemberID] = " & Me.memberID
strReportName = "Member Report"
DoCmd.OpenReport strReportName, acViewPreview, , strWhere
Then, make sure you remove the parameter prompt from the query.
--
Duane Hookom
Microsoft Access MVP
"RS" wrote:
I am new user and do not know much about Access Programming. I have a form
where I have a number field called memberid. I have created a report called
member report which works baed on memberquery. Which is baed on a query
memberquery. I have a form which fromupdate . I want to put a command button
on this page. I want this command button to read value from memberid textbox
and generate the report for only that member.
I have parametrized the query and it asks me enter memberid and then
genrates the report for that member.
I want this to happen just by clicking that button. It should be able to
read memberid field value and create report for only that member. I do not
want a dialogbox to appear asking me the memberid.
Thank You in advance.
|