problem with printing reports

  • Thread starter Thread starter Smoki
  • Start date Start date
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?
 
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.
 
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!
 
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
 
Back
Top