query

orshims

Registered User.
Local time
Today, 08:08
Joined
Jan 6, 2010
Messages
41
hi all
i have created a query based on a form i have created. however the form will not have data in all the fileds how do i create a report from that query but exclude the fileds that have no data in them

please help!!

thanks
 
orshims, you might want to rethink your strategy. Why is it a problem if a report displays a field that is empty? On some records a field could be empty, but on others it could be populated, so the field should be on the report, right?
Having said that, there is an option on the report to shrink empty fields and to allow fields to grow. For me this is usually on comments fields which can be empty, one line, or a paragraph. And Access has the capability to hide it, show it, or expand the report to show it all. Let me know if this is what you are asking.
Cheers
Privateer
 
hi privateer
within the form the user has to populate there are menus with 5 combo boxes to select from. what i was trying to achieve if for instance the user only needs to select from 3 of the combo boxes i dont want there to be a blank in the other two when i run the report.
i created a databease for tooling the form includes a menu for cutters drills taps etc and there will be 5 combo boxes to choose from another list and sometimes there wont be exacly 5 of each tooling

i hope this makes sence

thanks in advance
 
Orshims,
Well, I still don't understand why it would be such a bad thing if the empty fields were displayed on the report, but it is your report, so here is your answer.
In the report you need to set the shrink property of the fields in question to Yes. Then you need to set the shrink property of the area where the fields are placed also to Yes. If these fields are in the detail section, right click on the box in the upper left corner of the detail bar to see the properties of that section and set Shrink to Yes. Here is the kicker, if there are any other fields with data to display in that section, meaning, on the same "row" as the one to hide, the shrinking will not occur. The shrinking occurs by row and one valid bit of data causes the entire row to display. If the fields are "stacked", and the lowest one is empty, it will shrink. Another option is to place each field is in its own group and the group and field are allowed to shrink, then it will disappear.
If your group must have multiple fields in the same section, then you need to write code behind the report. Create a module for the report, select the section the fields are in (like Detail) and run an IF statement for each field, something like, If IsNull(Me.Taps.value) = true then Me.taps.visible = false else Me.taps.visible = true end if.
Anyway, that's three options, let me know which one works for you and if you need further help with it.
Cheers,
Privateer
 

Users who are viewing this thread

Back
Top Bottom