Frustrating ampersand problem with label on report

  • Thread starter Thread starter Tony M
  • Start date Start date
T

Tony M

Hello. I have a report with a multiline label. I am using the
Detail_Format event to assign a value to the label's caption in code.

If I set the label's caption to:
FAS Hake - #1 Pacific Hake, H&&T<vbcrlf>
FAS Hake - #1 Pacific Hake, H&&T, IQF<vbcrlf>
FAS Hake - #2 Pacific Hake, H&&T

the label prints:
FAS Hake - #1 Pacific Hake, H&T
FAS Hake - #1 Pacific Hake, H&T, IQF
FAS Hake - #2 Pacific Hake, H&&


Even more strangely, if I assign
FAS Hake - #1 Pacific Hake, H&T<vbcrlf>
FAS Hake - #1 Pacific Hake, H&T, IQF<vbcrlf>
FAS Hake - #2 Pacific Hake, H&T

to the label, it prints:
FAS Hake - #1 Pacific Hake, HT
FAS Hake - #1 Pacific Hake, HT, IQF
FAS Hake - #2 Pacific Hake, H&T

If I only assign two lines to the label, everything is ok, the label
only gets scrambled when it has 3 or more lines.

Any ideas on why my report is misbehaving the way it is?

Tony
 
Hello. I have a report with a multiline label. I am using the
Detail_Format event to assign a value to the label's caption in code.

If I set the label's caption to:
FAS Hake - #1 Pacific Hake, H&&T<vbcrlf>
FAS Hake - #1 Pacific Hake, H&&T, IQF<vbcrlf>
FAS Hake - #2 Pacific Hake, H&&T

the label prints:
FAS Hake - #1 Pacific Hake, H&T
FAS Hake - #1 Pacific Hake, H&T, IQF
FAS Hake - #2 Pacific Hake, H&&


Even more strangely, if I assign
FAS Hake - #1 Pacific Hake, H&T<vbcrlf>
FAS Hake - #1 Pacific Hake, H&T, IQF<vbcrlf>
FAS Hake - #2 Pacific Hake, H&T

to the label, it prints:
FAS Hake - #1 Pacific Hake, HT
FAS Hake - #1 Pacific Hake, HT, IQF
FAS Hake - #2 Pacific Hake, H&T

If I only assign two lines to the label, everything is ok, the label
only gets scrambled when it has 3 or more lines.

Any ideas on why my report is misbehaving the way it is?

Tony

Never mind, after googling the groups, I found that this is a bug in
Access. Whenever 3 or more ampersands appear in a label, the label
will do funny things with the last ampersand. I guess I'll have to
use a text box instead of a label.

Tony
 

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

Back
Top