From: jpm on
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.



From: Duane Hookom on
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(a)Idetestspam@mars> wrote in message
news:e0$kB1E9KHA.3840(a)TK2MSFTNGP02.phx.gbl...
> 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.
>
>
>
From: jpm on
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" <duanehookom(a)gmail.com> wrote in message
news:11B0E15E-B5A9-4B5E-A409-75D349A1E868(a)microsoft.com...
> 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(a)Idetestspam@mars> wrote in message
> news:e0$kB1E9KHA.3840(a)TK2MSFTNGP02.phx.gbl...
>> 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.
>>
>>
>>


From: Duane Hookom on
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(a)Idetestspam@mars> wrote in message
news:#fPVJtI9KHA.508(a)TK2MSFTNGP06.phx.gbl...
> 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" <duanehookom(a)gmail.com> wrote in message
> news:11B0E15E-B5A9-4B5E-A409-75D349A1E868(a)microsoft.com...
>> 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(a)Idetestspam@mars> wrote in message
>> news:e0$kB1E9KHA.3840(a)TK2MSFTNGP02.phx.gbl...
>>> 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.
>>>
>>>
>>>
>
>
From: Steve on
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
santus(a)penn.com


"jpm" <uh(a)Idetestspam@mars> wrote in message
news:e0$kB1E9KHA.3840(a)TK2MSFTNGP02.phx.gbl...
> 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.
>
>
>


 |  Next  |  Last
Pages: 1 2
Prev: Report summary
Next: Dynamic Reporting System