Only view selected fields (1 Viewer)

daveUK

Registered User.
Local time
Today, 23:46
Joined
Jan 2, 2002
Messages
234
Hi

I am creating a fairly simple staff database in Access 97. The 'tblDetails' holds all of the staff information, such as firstname, surname, intials, address, email_address, etc.

I have created a multi-select listbox that allows users to select, which fields they want to view i.e. surname and email_address. The selected values are saved to a temporary table (so if they select surname and email_address, the words 'surname' and 'email_address' are saved).

What I need to do now is to display the required fields in a report i.e. all of the surnames and email_addresses.

I am having major problems trying to design a query that will allow me to do this.

Any ideas?

Dave
 
Last edited:

dcx693

Registered User.
Local time
Today, 18:46
Joined
Apr 30, 2003
Messages
3,265
Some of the solutions I'm thinking of require coding the SQL statement, then setting the controlsources of the report controls. But why be some complex about it? Why not use the Access report wizard?
 

daveUK

Registered User.
Local time
Today, 23:46
Joined
Jan 2, 2002
Messages
234
Thanks for the reply.

I don't think I've explained the problem properly or maybe I didn't understand the answer. It could be that I'm looking for a mroe complicated answer than I need.

The values that are selected from the listbox are the names of the fields in the tblDetails. So, for example, users can choose address and surname. But it is these words that are stored in the table not the actual values, so when I run a report all I get are the words address and surname not the surnames and addresses of the staff.
 

daveUK

Registered User.
Local time
Today, 23:46
Joined
Jan 2, 2002
Messages
234
I've decided to structure the form slightly different. Rather than using a listbox, I'm now using option buttons and with a simple bit of code behind the report, I can only display the headings which are required.
 

Users who are viewing this thread

Top Bottom