Combining Texts and Field in Heading

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a simple database in Access 2000 that contains vocabulary words. It
also tracks the chapter, section of the chapter, and page that the word
appears on.

Field Names:

ID
Word
Definition
Chapter
Section
Page

I'm having a problem getting the section number to appear after text in the
same text box.

My page header has:

Vocabulary Words

Text Box: ="Chapter " & [chapter](works fine)

Section Heading:

Text Box =[chapter] & " - " & [Section](getting error message)

Word Definition Page

Detail:

Word Definition Page

----------------------------------

I'm getting an error for the section. It should read 1-1, 1-2, etc.

I'm not sure why Access is giving me an error message. It works fine when
I'm not trying to combine [chapter] and [section] in the same text box.

Thanks.

jbc
 
Make sure the name of the text box is not also the name of a field. If that
doesn't work, are your fields numeric? If so, try:

=Str([chapter]) & " - " & Str([Section])
 
Duane,

I'm still getting an error. They were formatted as numbers. I changed it
to text, removed the str commands and it still didn't work.

One strange thing. Maybe this will help you. The fields are named Chapter
and Section. When I created the text box, for the chapter number

="Chapter " & [chapter]

The first letter of chapter did not capitalize. Access changed the
lowercase s in Section to an uppercase. I thought this was strange. The
chapter text box is working and the section is not.

Thank you.

jbc



Duane Hookom said:
Make sure the name of the text box is not also the name of a field. If that
doesn't work, are your fields numeric? If so, try:

=Str([chapter]) & " - " & Str([Section])
--
Duane Hookom
MS Access MVP


jbc said:
Hello,

I have a simple database in Access 2000 that contains vocabulary words. It
also tracks the chapter, section of the chapter, and page that the word
appears on.

Field Names:

ID
Word
Definition
Chapter
Section
Page

I'm having a problem getting the section number to appear after text in the
same text box.

My page header has:

Vocabulary Words

Text Box: ="Chapter " & [chapter](works fine)

Section Heading:

Text Box =[chapter] & " - " & [Section](getting error message)

Word Definition Page

Detail:

Word Definition Page

----------------------------------

I'm getting an error for the section. It should read 1-1, 1-2, etc.

I'm not sure why Access is giving me an error message. It works fine when
I'm not trying to combine [chapter] and [section] in the same text box.

Thanks.

jbc
 
jbc said:
Duane,

I'm still getting an error. They were formatted as numbers. I changed it
to text, removed the str commands and it still didn't work.

One strange thing. Maybe this will help you. The fields are named Chapter
and Section. When I created the text box, for the chapter number

="Chapter " & [chapter]

The first letter of chapter did not capitalize. Access changed the
lowercase s in Section to an uppercase. I thought this was strange. The
chapter text box is working and the section is not.


Section is a reserved word and Access may not be able to
deduce which use you want in this situation.

I recommend you change the name of the field to something
other than section. In the short term, you might be able to
resolve the ambiguity by using:
Report.Fields!Section
 
Good catch Marsh.

--
Duane Hookom
MS Access MVP


Marshall Barton said:
jbc said:
Duane,

I'm still getting an error. They were formatted as numbers. I changed it
to text, removed the str commands and it still didn't work.

One strange thing. Maybe this will help you. The fields are named Chapter
and Section. When I created the text box, for the chapter number

="Chapter " & [chapter]

The first letter of chapter did not capitalize. Access changed the
lowercase s in Section to an uppercase. I thought this was strange. The
chapter text box is working and the section is not.


Section is a reserved word and Access may not be able to
deduce which use you want in this situation.

I recommend you change the name of the field to something
other than section. In the short term, you might be able to
resolve the ambiguity by using:
Report.Fields!Section
 
Marshall,

I hope you read this reply. I renamed the field SectionNumber and it works
like a charm!!!!

Thank you.

jbc

Marshall Barton said:
jbc said:
Duane,

I'm still getting an error. They were formatted as numbers. I changed it
to text, removed the str commands and it still didn't work.

One strange thing. Maybe this will help you. The fields are named Chapter
and Section. When I created the text box, for the chapter number

="Chapter " & [chapter]

The first letter of chapter did not capitalize. Access changed the
lowercase s in Section to an uppercase. I thought this was strange. The
chapter text box is working and the section is not.


Section is a reserved word and Access may not be able to
deduce which use you want in this situation.

I recommend you change the name of the field to something
other than section. In the short term, you might be able to
resolve the ambiguity by using:
Report.Fields!Section
 
Back
Top