Having a hard time programmatically making reports (1 Viewer)

blacksaibot

Registered User.
Local time
Yesterday, 22:06
Joined
Jan 20, 2010
Messages
31
I can barely find answers in google or MSDN.

I'm trying to find a tutorial, or at least some sample code on how to programmatically create a report.

What I have now is a Form that opens up with the Access database with drop down menus that allows people to use my own interface to customize a report, because the users of this database don't want to learn access.

So for example:

There is a combobox that allows you to select what kind of filter to use on a pre-existing report (say you want to only see certain records).

Then you click a button that loads the report and it has been changed according to what the user selected in the combobox.



Through the use of the interface/form I create, the code will also have to be able to add/remove certain controls so it can hide/display information depending on what the user wants. :confused: :(

I appreciate any help.
 
Last edited:

blacksaibot

Registered User.
Local time
Yesterday, 22:06
Joined
Jan 20, 2010
Messages
31
I can't even get a simple button to execute my event procedure!!

on the OnClick event I tell it to change the caption of a label to something else, and it doesn't even do THAT!


label32.caption="Whatever"


Is that not correct code?!?!
 

DJkarl

Registered User.
Local time
Yesterday, 21:06
Joined
Mar 16, 2007
Messages
1,028
try Me.label32.caption = "Whatever" if you are in the same form.
or Forms![FormName]![label32].Caption = "Whatever"

As far as programmatically creating a report I have to ask why would you want to? If you are referring to changing criteria at runtime or something of that nature then that's ok, if you actually want to create a new report object and all the controls and code that goes with it I can't see the value, the amount of dev time will far exceed creating it through the GUI.
 

blacksaibot

Registered User.
Local time
Yesterday, 22:06
Joined
Jan 20, 2010
Messages
31
try Me.label32.caption = "Whatever" if you are in the same form.
or Forms![FormName]![label32].Caption = "Whatever"

As far as programmatically creating a report I have to ask why would you want to? If you are referring to changing criteria at runtime or something of that nature then that's ok, if you actually want to create a new report object and all the controls and code that goes with it I can't see the value, the amount of dev time will far exceed creating it through the GUI.

I COMPLETELY Agee with you. However, I'm doing it for work. The users of the database are hard headed and insist that Access' GUI is confusing and hard to learn. So they want me to make an already user friendly interface "more friendly"

Neither of your example code work... (and I did check the spelling etc. etc.)
why is VBA so much more difficult than VB.NET
 

DJkarl

Registered User.
Local time
Yesterday, 21:06
Joined
Mar 16, 2007
Messages
1,028
Well keep in mind then that in order to do that the object has to be opened in design view, also adding in Code and tying it to controls on the form can be tricky if you are trying to create the object in the same database your form exists in (if you have a password on your VBA project it will be impossible to add new code while it's locked).

I have never created a report on the fly but have created modules and forms...and I can say it's not something I would like to do again if it all possible. The intent of the report object is really to create something that will have the same format and look day after day, if the users want something where they can pick columns and such look at building a query on the fly then export it to Excel and format it there, much easier in the long run.
 

Users who are viewing this thread

Top Bottom