Trying to get filtered Report based on form combo box

G

Guest

I submitted a question about making a form and combo box act like a parameter
query a couple of weeks ago. Someone gave me some help but I still can't get
it to work.

The combo box is linked to the proper list but when I run the report I am
having two problems.

1. THe report is not being filtered like I want.
2. I can't get it to preview, it keeps trying to print.

Here is the code I have (minus all of the variations I have tried):

On Error GoTo Err_CmdRunRpt_Click

DoCmd.OpenReport "RptProgramInventory", , , "[ModelNo] = '" &
Me.ProgramCombo & "'"

Exit_CmdRunRpt_Click:
Exit Sub

Err_CmdRunRpt_Click:
MsgBox Err.Description
Resume Exit_CmdRunRpt_Click

End Sub

Any suggestions would be greatly appreciated!

Thanks!
 
G

Guest

Have you set a breakpoint and looked the value returned by your combo?
Don't forget, it will return the bound column (not necessarily the one you
see on screen).

To open the report in preview mode try this:
DoCmd.OpenReport "RptProgramInventory", acViewPreview, , "[ModelNo] = '" &
Me.ProgramCombo & "'"

Steve
 

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