problem with printing reports

S

Smoki

Hi,
I have a problem with printing reports from form. I have a form with
subform, and I can choose something from combo box, then all fields on subfom
have been filled. I have a command button on form which opens report.
But, report always remember first value, like it doesn't see what I choose
in combo box!
What to do?
 
R

Ryan

Add this to the code you use to open the report.

If Me.Dirty Then
DoCmd.RunCommand acCmdSaveRecord
End If

Now your code to open the report.
 
S

Smoki

Sorry, but it didin't solve my problem. Maybe this is something with report,
not in code for command button. But I don't know what!
 
J

Jim Bunton

look at help openreport method
DoCmd.OpenReport reportname[, view][, filtername][, wherecondition]

the exmple it give is probably something like

DoCmd.OpenReport "Sales Report", acViewNormal, "Report Filter"

you probably need to use the wherecondition

so:
DoCmd.OpenReport "yourreportname", acViewNormal, ,
"acolumnonthereportquery =" & me.yourcomboboxname

me. means the form note that a blank spece is left where filtername was used
in the example. items in the parameter list in [ ] are optional

Jim Bunton
 

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