Problem filtering and opening a report

J

John F

I have a report based on a query that gives me all records and I would like
to use a form to filter the report and retrieve either a single record or a
group of records based upon which filter I apply.

On a form called RunReportsFiltered I have an unbound Combo Box called
[NameFilter]. It picks a persons name which is a calculated field in the
query called [CombinedName] which equals [LastName] & "," & [FirstName].

In the code I set SingleName = [NameFilter]
DoCmd.OpenReport "Complete Record", acViewPreview, "Report Query",
"CombinedName = " & SingleName

This gives me an Syntax error (comma) in query expression.

Need Help
Thanks
 
O

orange via AccessMonster.com

John said:
I have a report based on a query that gives me all records and I would like
to use a form to filter the report and retrieve either a single record or a
group of records based upon which filter I apply.

On a form called RunReportsFiltered I have an unbound Combo Box called
[NameFilter]. It picks a persons name which is a calculated field in the
query called [CombinedName] which equals [LastName] & "," & [FirstName].

In the code I set SingleName = [NameFilter]
DoCmd.OpenReport "Complete Record", acViewPreview, "Report Query",
"CombinedName = " & SingleName

This gives me an Syntax error (comma) in query expression.

Need Help
Thanks
You may try http://www.fontstuff.com/access/acctut19.htm
or this video tutorial
http://www.datapigtechnologies.com/flashfiles/passparamtoreport.html
 
R

ryguy7272

Data Pig is a great resource!! Take a look at this too:
http://www.fontstuff.com/access/acctut19.htm

Read the article and download the sample at the bottom of the page:
AccessAndSQL6_2000.zip [115KB]

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


orange via AccessMonster.com said:
John said:
I have a report based on a query that gives me all records and I would like
to use a form to filter the report and retrieve either a single record or a
group of records based upon which filter I apply.

On a form called RunReportsFiltered I have an unbound Combo Box called
[NameFilter]. It picks a persons name which is a calculated field in the
query called [CombinedName] which equals [LastName] & "," & [FirstName].

In the code I set SingleName = [NameFilter]
DoCmd.OpenReport "Complete Record", acViewPreview, "Report Query",
"CombinedName = " & SingleName

This gives me an Syntax error (comma) in query expression.

Need Help
Thanks
You may try http://www.fontstuff.com/access/acctut19.htm
or this video tutorial
http://www.datapigtechnologies.com/flashfiles/passparamtoreport.html

--



.
 

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