Find Single Record for Report

C

Chris Nebinger

Do you have the form made up?

There are different ways you can do this. The easiest is
to create the form, and add the button to it. Then, use
the DoCmd.OpenReport method with the WhereCondition:

dim strWhere as String
strWhere = "NumericField=" & Me.Control1
strWhere = strWhere & " AND TextField = '" & me.Control2
& "'"
strWhere = strWhere & " AND DateField = #" & me.Control3
& "#"
docmd.OpenReport "ReportName",acViewPreview ,,strWhere


Now, replace the Control1, Control2, & Control3 names with
the real control names. Also, keep in mind that you have
to use the single quotes for text fields (and memo), and
the pound signs for date/time fields.

Chris Nebinger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top