Question : Access 2007 report design question

I am currently working on building a facility managment solution for my office to use in which I have a building table which contain address, city, zip, police, fire, etc for each building and also a complex table which I have a multi select combobox with the buildings id and name to "add" the building to the complex group along with address, city, zip, police, fire, etc for each complex. What I am wanting to do is design a report in which groups the buildings by complex and if there is an address for the complex it would display this information with the complex name in the report but if a building has any different informatiot from the complex address for it to display it with the building name.

Answer : Access 2007 report design question

I would start by creating the query that returns the complex names and addresses and the building names and addresses all in one query.

Then I would create a report based on this query, and set the initial grouping by the Complex Name or Complex ID.  Put all of the "complex" textboxes in the group header.

Then put all of the building name and address info in the reports details section.  Then in the detail sections Format event add some code that looks similar to the following to hide the address fields if they match those of the complex.

Private Sub Detail_Format()

     Dim bVisible as boolean

    bVisible = me.txt_Complex_Address <> me.txt_Building_Address
    me.txt_BuildingAddress.Visible = bVisible
    me.txt_BuildtingStreet.visible = bVisible
    me.txt_BuildingCity.visible = bVisible
    me.txt_BuildingZip.visible = bVisible

End Sub

HTH


Random Solutions  
 
programming4us programming4us