Displaying only part of a field

Jon123

Registered User.
Local time
Today, 09:19
Joined
Aug 29, 2003
Messages
668
On a report I have a field that has a value that can be anywhere from 15 to 25 char. Can I set up the report field to only display the 1st 10 char. ?

jon
 
Last edited:
I put this line in the on open property of the report and it won't take it. Error "expected = "

Left ([Module],10)
 
Add the equal sign before the statement, like below:

=Left ([Module],10)
 
I'm still get an error "expected line number or end of statement"

Jon
 
The examples shown include an unwanted space, i.e.
= left (
versus
= left(

try this experiment from the debug (immediate) window:

myfield = "the quick brown fox jumped"
? left(myfield, 12)
the quick br
 
Does it make a difference if this a subform?

On the on open event of the subforn I typed this code

Left([Module], 10) this one errored expected ='s

so I put this coed


=Left([Module],10) this one errored for expected line number

in but cases the code turned red and would not compile.

Jon
 
Jon -

A little confused here. This started out as a report and it's now become a subform? In either case, the OnOpen option is probably not going to fly.

If you want to only display the first x characters of a field, then create a query and incorporate your criteria, e.g. mymodule = left([module], 10), and use that as your report / subform record source.

Bob
 
Sorry for the confusion my typo it is a sub report.

anyway I like the querry idea. Is there a way that I can add a field to the qry grid and have that field do an If statement rather then cutoff part of the field value?
Meaning something like this

= If [Module] = "Mainframe xxxxxx" Then [Module] = "Mainframe"

jon
 

Users who are viewing this thread

Back
Top Bottom