Question : Report Generation [Access]

Hi,

I have a Access report which has to be executed manually for each Name in Staff Table. Then the report calculates few function and Updates the value in Staff Summary Table.

Is it possible, to run the report in a Loop with just one click.

What I meant with one click is, As soon as the User Clicks on Button. It will run the report in Back End in a loop for each DISTINCT Staff Name and will not be shown to the user.

I Hope I made my question clear.

Answer : Report Generation [Access]

You don't need to use SelectObject - remove that line.

Your OpenReport call is still not correct. Assuming that "DriverName" is the field you're using to filter the report:

With rst
  .MoveFirst
  While Not .EOF
      DoCmd.OpenReport "Staff Salary Report", acViewPreview, , "DriverName='" &  .Fields("StaffName") & "'"
      DoCmd.PrintOut
      DoCmd.Close acReport, "Staff Salary Report"
  .MoveNext
  Wend
End With


 

Random Solutions  
 
programming4us programming4us