Limiting characters in a text field

K

Karrybelle

My Project Management team added some new custom Enterprise text fields but
they want to limit how many characters that can be in the text fields. Can
someone shead some light on how I can limit the characters from 255 to only
50.

Thanks!
 
G

Gérard Ducouret

Karrybelle,

It is not possible in a simple interactive way. It could be possible in VBA,
using a taskchange event for example, but not easy at all.
Sorry,

Gérard Ducouret
 
K

Karrybelle

Do you know how it would be changed in VBA? Even though it may be difficult
the Project Managers prefer that if it is possible they would like it changed
in Microsoft Project for reporting reasons.
 
J

John

Karrybelle said:
Do you know how it would be changed in VBA? Even though it may be difficult
the Project Managers prefer that if it is possible they would like it changed
in Microsoft Project for reporting reasons.

Karrybelle,
Pardon me for butting in. Even though it can be done with a TaskChange
event macro, the complexity of that might be more trouble than its
worth. Let me offer a couple alternate approaches.

First, for instances like this the best approach is often training. Set
up a "rules of use" guide for all users of Project in your organization.
In addition to just limiting the number of characters in text fields,
this guide can also give consistency on how users set up project plans,
how they status and maintain those plans and any other relevant items
including how to use Project correctly. But don't just create a guide
and then distribute it, rather set up training classes for all users
using the guide as the training basis. The company I worked for and many
other entities who use Project on a regular basis prefer this approach
over the covert "control".

Second, here is an idea that is between pure training and pure covert
control (i.e. TaskChange event macro). Set up a formula in a spare flag
field that counts the characters in the desired text field. If that
count exceeds 50, set the flag. A filter can then be used to easily find
tasks that have the flag set. A simple macro could be used to detect
filter results and pop up a user message.

Hope this helps.
John
Project MVP
 
K

Karrybelle

While we do train our Project Manager the reasoning behind why they would
like to limit the characters is because we do not use Project Server to
create the reports but it is pulled in Cognos 8 which limits what can be seen
and will cut off the information if there is too much. Yes, adjustments can
probably be made to the report itself for each project but it is strongly
desire to have all reports uniformed. They are hoping to elimiate this
problem by limiting how long descriptions can be. Which brings me back to
the issue of how do I limit how many characters can be in a text field.
 
K

Karrybelle

For any PM that exceeds the limit of 50 they would have to go back into every
project and edit their projects so it fits within the requirements.

How would I be able to limit characters by a macro and is there a way that I
could make it on an Enterprise level so that every single PM does not have to
run it themselves when updating their projects?
 
J

John

Karrybelle said:
While we do train our Project Manager the reasoning behind why they would
like to limit the characters is because we do not use Project Server to
create the reports but it is pulled in Cognos 8 which limits what can be seen
and will cut off the information if there is too much. Yes, adjustments can
probably be made to the report itself for each project but it is strongly
desire to have all reports uniformed. They are hoping to elimiate this
problem by limiting how long descriptions can be. Which brings me back to
the issue of how do I limit how many characters can be in a text field.

Karrybelle,
OK, that's fine. How about trying my second suggestion? It can be done
with an TaskChange event macro as Gerard suggested but it is more
complex and will probably "fire" every time any change is made to the
task, not just when the text field is changed. That's why I suggested a
simpler macro that informs the user - either on command (i.e. when the
user specifically initiates the macro), or perhaps when they try to
close the file (FileClose event macro which is more straightforward than
the TaskChange event).

John
Project MVP
 
J

Jim Aksel

Couldn't resist jumping on the pile.
This is purely a training issue. Let the users know that only the first 50
characters of their response will be carried forward. Show them an example
and be done with it.

Now, if the text exceeds 50 characters, I have two solutions.
1. A macro in VBA that cuts the length back to 50 characters. It can be
automatic, but that tends to slow things down since it executes every time
the enter key is pressed. Here is a stand alone macro that will chop the text
when the macro is run after the fact.

Sub CutAt50()
Dim t As Task
For Each t In ActiveProject.Tasks
If Not t Is Nothing Then
If Len(t.Notes) > 50 Then
Dim sNote As String
sNote = Left(t.Notes, 50)
t.Notes = sNote
sNote=Nothing
End If
End If
Next t
End Sub


2. Charge the user $5 per character. That macro is a little harder...
--
If this post was helpful, please consider rating it.

Jim Aksel, MVP

Check out my blog for more information:
http://www.msprojectblog.com
 

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