Report Wizard through VBA

  • Thread starter Thread starter justinlucy
  • Start date Start date
J

justinlucy

Guest
I have a database the allows the users to create a query that has selectable fields (ie the are different depending on what the user selects). I currently export this to excel so the users can make graphs etc on their choices, but would like the create a report in Access based on this as well. Is there a way to create a report based on this? I was thinking it would have to use the report wizard so it can create the field headings everytime it is run.

Thanks
 
I don't *think* you can call the Report Wizard from VBA, but then I may well be wrong. How many permutations of reports can you have? How different are the reports (i.e. is it simply less/more fields, or does the structure change)?
 
I currently haven't built any reports for this, due to the field variation, but number of fields is pretty much the only variable. Is there a way to build the entire report from scratch in VBA? Or only have a shell of a report all add all the field headers and records in VBA?

Thanks
 
I don't think you can create a report in VBA. I think you will have to start with a report with all possible values in, then via VBA, hide/shrink/move the fields as required. What is your VBA like? Unless its pretty strong you are going to find this difficult.
 
I have been learning VB as I go ... about 3 months now.

Thanks, this might be one of those projects I work on for a while and as my knowledge gets greater, I will be able to finish it.
 
DoCmd.RunCommand acCmdNewObjectReport
DoCmd.RunCommand accmdnew
 

Users who are viewing this thread

Back
Top Bottom