A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Dynamically Add fields/controls to reports



 
 
Thread Tools Display Modes
  #1  
Old May 15th, 2010, 05:39 PM posted to microsoft.public.access.reports
jpm[_3_]
external usenet poster
 
Posts: 11
Default Dynamically Add fields/controls to reports

Hello,

I've not much experience with building reports in MsAccess. Can one
dynamicall add fields/controls to reports from a vba module such as that
linked to a form? i.e. do processing . . .set a sql string as a report's
recordsource, then have the fields of the recordsource added or displayed in
the report. I want to do this without having predefined the report
content/format, etc. Can someone give me information or point me to
information on this?

Part of my reason for persuing this data display method is that there
doesn't seem to be a grid control for displaying data on a form. So, how
about a report that is built dynamically; can I do that?

Thanks for any help,

Jim M.



  #2  
Old May 15th, 2010, 11:29 PM posted to microsoft.public.access.reports
Duane Hookom[_4_]
external usenet poster
 
Posts: 316
Default Dynamically Add fields/controls to reports

Typically reports are well defined for publication. If you need to add
controls and change record sources you can do this with VBA. To add
controls, you would need to be in design view.

I would attempt to find a different solution. You can set the Source Object
of subform control to a query. This is much like a grid control and you
don't need to know the fields returned.

--
Duane Hookom
MS Access MVP


"jpm" uh@Idetestspam@mars wrote in message
...
Hello,

I've not much experience with building reports in MsAccess. Can one
dynamicall add fields/controls to reports from a vba module such as that
linked to a form? i.e. do processing . . .set a sql string as a report's
recordsource, then have the fields of the recordsource added or displayed
in the report. I want to do this without having predefined the report
content/format, etc. Can someone give me information or point me to
information on this?

Part of my reason for persuing this data display method is that there
doesn't seem to be a grid control for displaying data on a form. So, how
about a report that is built dynamically; can I do that?

Thanks for any help,

Jim M.



  #3  
Old May 16th, 2010, 01:03 AM posted to microsoft.public.access.reports
jpm[_3_]
external usenet poster
 
Posts: 11
Default Dynamically Add fields/controls to reports

Thanks for the information.
I would like to add the controls and relate the recordsource fields to them
at run time.(when the report is programmatically loaded)
I'm understanding you to say this isn't possible. . .

If I stick a sub-form/report on a report object, can can I set the source
object to an ADO recordset in a non-ADP database file?
If so, will it automatically display the recordset(create fields for display
to the user?)
Are there examples of this that anyone can share?

Much appreciated.

Jim M.

"Duane Hookom" wrote in message
...
Typically reports are well defined for publication. If you need to add
controls and change record sources you can do this with VBA. To add
controls, you would need to be in design view.

I would attempt to find a different solution. You can set the Source
Object of subform control to a query. This is much like a grid control and
you don't need to know the fields returned.

--
Duane Hookom
MS Access MVP


"jpm" uh@Idetestspam@mars wrote in message
...
Hello,

I've not much experience with building reports in MsAccess. Can one
dynamicall add fields/controls to reports from a vba module such as that
linked to a form? i.e. do processing . . .set a sql string as a report's
recordsource, then have the fields of the recordsource added or displayed
in the report. I want to do this without having predefined the report
content/format, etc. Can someone give me information or point me to
information on this?

Part of my reason for persuing this data display method is that there
doesn't seem to be a grid control for displaying data on a form. So, how
about a report that is built dynamically; can I do that?

Thanks for any help,

Jim M.





  #4  
Old May 16th, 2010, 05:21 AM posted to microsoft.public.access.reports
Duane Hookom[_4_]
external usenet poster
 
Posts: 316
Default Dynamically Add fields/controls to reports

It's not impossible to add controls to reports at run time (unless you have
and MDE). I just think is so much work that I would find another method such
as exporting a query's records to Excel or something similar. I'm not sure
what in your application requires you to create text boxes at run time.

--
Duane Hookom
MS Access MVP


"jpm" uh@Idetestspam@mars wrote in message
...
Thanks for the information.
I would like to add the controls and relate the recordsource fields to
them at run time.(when the report is programmatically loaded)
I'm understanding you to say this isn't possible. . .

If I stick a sub-form/report on a report object, can can I set the source
object to an ADO recordset in a non-ADP database file?
If so, will it automatically display the recordset(create fields for
display to the user?)
Are there examples of this that anyone can share?

Much appreciated.

Jim M.

"Duane Hookom" wrote in message
...
Typically reports are well defined for publication. If you need to add
controls and change record sources you can do this with VBA. To add
controls, you would need to be in design view.

I would attempt to find a different solution. You can set the Source
Object of subform control to a query. This is much like a grid control
and you don't need to know the fields returned.

--
Duane Hookom
MS Access MVP


"jpm" uh@Idetestspam@mars wrote in message
...
Hello,

I've not much experience with building reports in MsAccess. Can one
dynamicall add fields/controls to reports from a vba module such as that
linked to a form? i.e. do processing . . .set a sql string as a
report's recordsource, then have the fields of the recordsource added or
displayed in the report. I want to do this without having predefined
the report content/format, etc. Can someone give me information or
point me to information on this?

Part of my reason for persuing this data display method is that there
doesn't seem to be a grid control for displaying data on a form. So, how
about a report that is built dynamically; can I do that?

Thanks for any help,

Jim M.





  #6  
Old May 17th, 2010, 04:58 PM posted to microsoft.public.access.reports
jpm[_3_]
external usenet poster
 
Posts: 11
Default Dynamically Add fields/controls to reports

Steve,
My objective is to use one report as a "template" and feed it different
recordsources that have varying numbers of fields with varying field names
which can be displayed for a user to review the information.

This is what I posted earlier:

I would like to add the controls and relate the recordsource fields to them
at run time.(when the report is programmatically loaded)
I'm understanding you to say this isn't possible. . .

If I stick a sub-form/report on a report object, can I set the source
object to an ADO recordset in a non-ADP database file?
If so, will it automatically display the recordset(create fields for display
to the user?)
Are there examples of this that anyone can share?

Much appreciated.

Jim M.

"Steve" wrote in message
...
Please post what your database is about and why you want to do what you
describe here. There are ways to crate a dynamic report you may be able to
use.

Steve



"jpm" uh@Idetestspam@mars wrote in message
...
Hello,

I've not much experience with building reports in MsAccess. Can one
dynamicall add fields/controls to reports from a vba module such as that
linked to a form? i.e. do processing . . .set a sql string as a report's
recordsource, then have the fields of the recordsource added or displayed
in the report. I want to do this without having predefined the report
content/format, etc. Can someone give me information or point me to
information on this?

Part of my reason for persuing this data display method is that there
doesn't seem to be a grid control for displaying data on a form. So, how
about a report that is built dynamically; can I do that?

Thanks for any help,

Jim M.







  #7  
Old May 18th, 2010, 02:52 AM posted to microsoft.public.access.reports
Duane Hookom[_4_]
external usenet poster
 
Posts: 316
Default Dynamically Add fields/controls to reports

I generally include the Ad-Hoc/query by form applet available at
http://www.rogersaccesslibrary.com/f...m_topic12.html. It
allows users to select any number of fields and set various criteria etc.
Users are a couple clicks from pushing the results to Excel where they can
print them or whatever.

--
Duane Hookom
MS Access MVP


"jpm" uh@Idetestspam@mars wrote in message
...
Steve,
My objective is to use one report as a "template" and feed it different
recordsources that have varying numbers of fields with varying field names
which can be displayed for a user to review the information.

This is what I posted earlier:

I would like to add the controls and relate the recordsource fields to
them
at run time.(when the report is programmatically loaded)
I'm understanding you to say this isn't possible. . .

If I stick a sub-form/report on a report object, can I set the source
object to an ADO recordset in a non-ADP database file?
If so, will it automatically display the recordset(create fields for
display
to the user?)
Are there examples of this that anyone can share?

Much appreciated.

Jim M.

"Steve" wrote in message
...
Please post what your database is about and why you want to do what you
describe here. There are ways to crate a dynamic report you may be able
to use.

Steve



"jpm" uh@Idetestspam@mars wrote in message
...
Hello,

I've not much experience with building reports in MsAccess. Can one
dynamicall add fields/controls to reports from a vba module such as that
linked to a form? i.e. do processing . . .set a sql string as a
report's recordsource, then have the fields of the recordsource added or
displayed in the report. I want to do this without having predefined
the report content/format, etc. Can someone give me information or
point me to information on this?

Part of my reason for persuing this data display method is that there
doesn't seem to be a grid control for displaying data on a form. So, how
about a report that is built dynamically; can I do that?

Thanks for any help,

Jim M.







 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:03 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.