Display Description Field in Forms and Reports

G

Guest

Hi,

Can't seem to find any information on this... Is it possible to have the
content of the "Description" field used in Design view of tables display in
forms and reports?
 
A

Allen Browne

It can be done, but it's not as simple as it could be.

If Table1 has a Description, open the Immediate Window (Ctrl+G) and enter
this:
? CurrentDb.TableDefs("Table1").Properties("Description")

However, if Table1 has no description, this will probably yield runtime
error 3270. Therefore you need to write a function that uses error handling
to recover from the error where the Description does not exist.

If you try to do the same with queries, there's another problem. If the
query doesn't have a description, you may find that Access wrongly returns
the Description of one of the tables in the query as if it were the
description of the query - confusing!

Anyway, if you are interested in this kind of thing, the same issues arise
when you try to get the Description of the fields in table design. Here's a
funtion that illustrates how to do that:
http://allenbrowne.com/func-06.html

Oh, and if you need a query that gives you your table names:
SELECT MsysObjects.Name FROM MsysObjects
WHERE (([Type] = 1) AND ([Name] Not Like "~*") AND ([Name] Not Like
"MSys*"))
ORDER BY MsysObjects.Name;

Include types 4, 6 and 8 if you want to show linked tables.
The other objects are:
Queries: 5
Forms: -32768
Reports: -32764
Modules: -32761
 
G

Guest

Yikes! Very complicated.

The reason I wanted to do this is that I'm creating a database that will be
compiling the results of about 7 questionnaires. Each individual will fill
in a set of the 7 questionnaires.

So, I'm struggling with deciding how to structure my tables. Some of the
issues:

- Should I use the participant number as the PK or just an autonumber
- Should I name the field something descriptive, or just the questionnaire
question number, that is coded to also show what questionnaire is being used
- How do I handle the actual questions - they are too long to add as a field
name, so I had thought maybe adding them to descriptions, but now I am seeing
this could be complicated
- The questionnaires have a few sections - should I do one table per
questionnaire, or should I further break things down by section

Some of the issues I need to resolve before even starting to use Access!
Any input would be extremely appreciated!

--
Thanks!

Dee


Allen Browne said:
It can be done, but it's not as simple as it could be.

If Table1 has a Description, open the Immediate Window (Ctrl+G) and enter
this:
? CurrentDb.TableDefs("Table1").Properties("Description")

However, if Table1 has no description, this will probably yield runtime
error 3270. Therefore you need to write a function that uses error handling
to recover from the error where the Description does not exist.

If you try to do the same with queries, there's another problem. If the
query doesn't have a description, you may find that Access wrongly returns
the Description of one of the tables in the query as if it were the
description of the query - confusing!

Anyway, if you are interested in this kind of thing, the same issues arise
when you try to get the Description of the fields in table design. Here's a
funtion that illustrates how to do that:
http://allenbrowne.com/func-06.html

Oh, and if you need a query that gives you your table names:
SELECT MsysObjects.Name FROM MsysObjects
WHERE (([Type] = 1) AND ([Name] Not Like "~*") AND ([Name] Not Like
"MSys*"))
ORDER BY MsysObjects.Name;

Include types 4, 6 and 8 if you want to show linked tables.
The other objects are:
Queries: 5
Forms: -32768
Reports: -32764
Modules: -32761
 
A

Allen Browne

Dee, I suggest you download this sample database from Access MVP Duane
Hookom:
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='At Your Survey 2000'

It works with Access 2000 and later.

Open the Relationships window (Tools menu) to see how to relate the table of
questions to surveys, the possible responses for each question, and the
actual responses given.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

dee said:
Yikes! Very complicated.

The reason I wanted to do this is that I'm creating a database that will
be
compiling the results of about 7 questionnaires. Each individual will
fill
in a set of the 7 questionnaires.

So, I'm struggling with deciding how to structure my tables. Some of the
issues:

- Should I use the participant number as the PK or just an autonumber
- Should I name the field something descriptive, or just the questionnaire
question number, that is coded to also show what questionnaire is being
used
- How do I handle the actual questions - they are too long to add as a
field
name, so I had thought maybe adding them to descriptions, but now I am
seeing
this could be complicated
- The questionnaires have a few sections - should I do one table per
questionnaire, or should I further break things down by section

Some of the issues I need to resolve before even starting to use Access!
Any input would be extremely appreciated!

--
Thanks!

Dee


Allen Browne said:
It can be done, but it's not as simple as it could be.

If Table1 has a Description, open the Immediate Window (Ctrl+G) and enter
this:
? CurrentDb.TableDefs("Table1").Properties("Description")

However, if Table1 has no description, this will probably yield runtime
error 3270. Therefore you need to write a function that uses error
handling
to recover from the error where the Description does not exist.

If you try to do the same with queries, there's another problem. If the
query doesn't have a description, you may find that Access wrongly
returns
the Description of one of the tables in the query as if it were the
description of the query - confusing!

Anyway, if you are interested in this kind of thing, the same issues
arise
when you try to get the Description of the fields in table design. Here's
a
funtion that illustrates how to do that:
http://allenbrowne.com/func-06.html

Oh, and if you need a query that gives you your table names:
SELECT MsysObjects.Name FROM MsysObjects
WHERE (([Type] = 1) AND ([Name] Not Like "~*") AND ([Name] Not Like
"MSys*"))
ORDER BY MsysObjects.Name;

Include types 4, 6 and 8 if you want to show linked tables.
The other objects are:
Queries: 5
Forms: -32768
Reports: -32764
Modules: -32761

dee said:
Can't seem to find any information on this... Is it possible to have
the
content of the "Description" field used in Design view of tables
display
in forms and reports?
 
G

Guest

Hi and thanks for the help.. I clicked on the link but got
ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.

/Otherdownload.asp, line 32

If I go directly to the site, which links should I click on?

Thanks!
--
Thanks!

Dee


Allen Browne said:
Dee, I suggest you download this sample database from Access MVP Duane
Hookom:
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='At Your Survey 2000'

It works with Access 2000 and later.

Open the Relationships window (Tools menu) to see how to relate the table of
questions to surveys, the possible responses for each question, and the
actual responses given.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

dee said:
Yikes! Very complicated.

The reason I wanted to do this is that I'm creating a database that will
be
compiling the results of about 7 questionnaires. Each individual will
fill
in a set of the 7 questionnaires.

So, I'm struggling with deciding how to structure my tables. Some of the
issues:

- Should I use the participant number as the PK or just an autonumber
- Should I name the field something descriptive, or just the questionnaire
question number, that is coded to also show what questionnaire is being
used
- How do I handle the actual questions - they are too long to add as a
field
name, so I had thought maybe adding them to descriptions, but now I am
seeing
this could be complicated
- The questionnaires have a few sections - should I do one table per
questionnaire, or should I further break things down by section

Some of the issues I need to resolve before even starting to use Access!
Any input would be extremely appreciated!

--
Thanks!

Dee


Allen Browne said:
It can be done, but it's not as simple as it could be.

If Table1 has a Description, open the Immediate Window (Ctrl+G) and enter
this:
? CurrentDb.TableDefs("Table1").Properties("Description")

However, if Table1 has no description, this will probably yield runtime
error 3270. Therefore you need to write a function that uses error
handling
to recover from the error where the Description does not exist.

If you try to do the same with queries, there's another problem. If the
query doesn't have a description, you may find that Access wrongly
returns
the Description of one of the tables in the query as if it were the
description of the query - confusing!

Anyway, if you are interested in this kind of thing, the same issues
arise
when you try to get the Description of the fields in table design. Here's
a
funtion that illustrates how to do that:
http://allenbrowne.com/func-06.html

Oh, and if you need a query that gives you your table names:
SELECT MsysObjects.Name FROM MsysObjects
WHERE (([Type] = 1) AND ([Name] Not Like "~*") AND ([Name] Not Like
"MSys*"))
ORDER BY MsysObjects.Name;

Include types 4, 6 and 8 if you want to show linked tables.
The other objects are:
Queries: 5
Forms: -32768
Reports: -32764
Modules: -32761


Can't seem to find any information on this... Is it possible to have
the
content of the "Description" field used in Design view of tables
display
in forms and reports?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top