Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reports category...?

Status
Not open for further replies.

JZII

Technical User
Jan 26, 2001
37
SE
My database has aprox. 3000 fields that contains customer information. These are arranged in categories...
Lets say that I want to print all fields in 1 category. But the users of this database are quite "stupid" so they cant type the category name in the query box...

How can I make a query that first of all shows the different categories in a listbox, and then the users can select which category they like and get the report ready to print...

Anyone.....

Thanks! JZII
 
Do you really mean 3000 FIELDS ?
All in one table ????

If the category names are in one particular field then
A) They should be in a separate table and only a reference to that record stored in the main table - This would make maintenance ( and the solution to this problem ) easier and more intuitive.
B) You CAN do what you need. Like this:-

ComboBox.RowSource "SELECT DISTINCT fldCategory FROM tableName"

Then in the ComboBox AfterUpdate event you can do an
DoCmd.OpenReport "reportName" , , , "fldCategory = '" & ComboBox & "'"



'ope-that-'elps
G LS



 
Hi...

Thanks for the solution...

It worked...

But!

When I select the category it prints it direct. I would like to preview it before printing... How do I do that?

Thanks JZII
 
Add the acViewPreview as shown below into the line as it exists already.

DoCmd.OpenReport "reportName" , acViewPreview, , "fldCategory = '" & ComboBox & "'"





G LS

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top