PROGRAMAR EN ACCESS VBA

Aplicaciones access con visual basic for applications

  > Principal > reports access
 
.: Access
- Forms access
- reports access
- Forms Arcgis
- Data access
- FAQ
.: Pdas
- Program PDA
- Tutorial
- Examples
.: Forums
- Forum Access
- Forum PDAs
- Forum GIS
- Forum SQL
.: Blog
- Blog Access
.: SQL Access
- SQL Queries
- Tutorial
.: Geotools
- Geotools
 
 
.: Novedades
- Access Aplicattion
- Jobs at access
- Export documents access
- Image Library access
-Newssletters
 
 
.: Novedades
- Una Aplicacion Access
- Ofertas de trabajo en access
- Libros de access
- Catálogo de imágenes access
-Newssletters
 
Enlazar formularios con informes

ACCESS REPORTS

A report access is nothing more than a table or query displayed in a "sleek and dynamic", the reports are one of the most important access modules, as they allow you to automate to a large extent the development of documents from databases . Thanks to the tools of grouping and management of data, and combined with the code vba that we can associate the report, the results can be spectacular

.: Contratar Publicidad :.
 

 


Reports Elements

1.- Principal secctions

One report has the following main properties:

Pie in the report: It refers to the first page of the report, namely the cover of the report

Page Header: Data that will appear on every page of the report, specifically at the top

Description: This section includes the various records relating to the header of the page, which can be more than one, would like a subform within each page of the report.

Footer: It has the same function as the page header, but the data appear at the bottom


2.- Report functions

One report has the following main properties:

Pie in the report: It refers to the first page of the Group: One of the options of a report of access is more important to show the pooled data, selecting one or more subgroups. By pooling data so as not to repeat data in our report. For example, if we want to show the data from a table with properties throughout Spain, and we want the grouping according to the province, are we going to do this on the left side of the form in design view and with the right button to give you the option and Order Grouping:

Now select the fields you want to aggregate and order is what we want it to appear, once selected in the bottom see options, which must activate "header page." At this point the report creates a new header, which can include labels and text to the header of our report. The section will detail the records related to the main data header

Other interesting and very useful option is to force the jump from page appears when a new record that does not fit on the first page, to avoid this court that was so bad, we will simply maintain the option Together menu ordering and grouping and the value will to each other.

2.- Edit parameters in the section of detail

If we want to modify an attribute of the controls on the section of detail we will find some problems: for example, we have a series of records with a numeric value and other textual, and we want the text to be red when the numerical value 50 passes. One has value 25 and another 75. Therefore you should see a red and another color by default. The code for that to happen it must be included in the section datalle:

 

IF (me.valorNumerico > 50) then

me.controls("valorTextual").forecolor = 255

end if

but if we do this all appear in red, why? because it keeps the value last forever, therefore we should put:

 

IF (me.valorNumerico > 50) then

me.controls("valorTextual").forecolor = 255

else

me.controls("valorTextual").forecolor = 0

end if

This will check them one by one all the values and always gives the color to the label


3.-Edit parameters in the footnote on the basis of parameters of the detail section

If we want to add data as a summary in the section of the bottom of this page must be careful, for example, we want that section of detail we get an alert when a value of the section of detail exceeds a certain limit.

the code to include in the footnote section of serious

 

if (me.valorNum > 50) then

etiquetapie.caption = "alerta, uno de los valores sobrepasa limite"

end if

This may be correct, but it is not, because it will take the value of the numerical value of the last section of detail. To work properly we should add a boolean in the detail section:

 

incluir en la seccion pie de pagina

etiquetapie.caption = "alerta, uno de los valores........"

end if

With this code, once you find in value that exceeds the limit activate the Boolean and was no longer disabled, and the message of error.


4.-Modify parameters according to the report page in which we find ourselves

You can modify a parameter of the report depending on the same page that we are. If for example we want to put a footnote to the current site would create a label, and in the caption option we would

Etiqueta.caption : me.page

On the other hand, if the first page does not display the page number, as it is the home, we would the following code in the section of footnote:

 

if (me.page = 1) then

etiqueta.visible = false

else

etiqueta.visible = true

end if

 

 
Añadir a favoritos Contacto Libros sobre access y vba Enlaces Todo Access  
 
.: En ProgramarVBA podrá encontrar:        
Visual Basic Formularios Access Informes Foro de programación PDAs Conexión a bases de datos Blog de adps
Foro GIS Foro PDAs Tutorial VBA Bases de datos Access Foro SQL Acceso a datos access Informes access