make Report from Form??? (1 Viewer)

Access_guy49

Registered User.
Local time
Today, 08:32
Joined
Sep 7, 2007
Messages
462
Is it possible to make a report off the information displayed on a form... specifically the values displayed in unbound text boxes which have been populated through VBA????
 

Trevor G

Registered User.
Local time
Today, 13:32
Joined
Oct 1, 2009
Messages
2,341
Yes, If your form is bound to a query or table then you can do the following

go into design view of the form, highlight all the objects and use a normal copy command. Then create a new report in design view and in the detial section paste in all the objects.

Then you have to open the properties of the report and select the same source as the form is using.

Then go to the unbound text box and open the properties and in the control source you can open the build wizard to then select the form and the unbound text box (good idea to name each one first). As this then gives you the source you can either leave it like that or take a copy of the source and open the details section properties and then select the Events tab select On format and then go into the VBA screen.

You can then add something like this

me.textboxname.value = formname!textboxname.value

And so on if there are a number of textbox you need to repeat this.
 

vbaInet

AWF VIP
Local time
Today, 13:32
Joined
Jan 22, 2010
Messages
26,374
Create the report in the same way as you would create the form. To filter the records in the report from the form, use the WHERE part of the OpenReport method. This example shows the OpenForm method:

http://baldyweb.com/wherecondition.htm

OpenForm and OpenReport are essentially the same so just substitute OpenForm for OpenReport and note the number of commas.
 

Users who are viewing this thread

Top Bottom