truncate combo box text

lloyd33

Registered User.
Local time
Today, 14:03
Joined
May 6, 2003
Messages
37
hi all
:confused:


I would like to limit the text entered within a combo box to a value no more than 10 characters then automatically truncate the values if the number of characters is greater than 10. I have placed code on the not in list event of a combo box this is an extract

If Len(NewData) > 10 Or blkok = True Then

DisplayMessage "Text Too Long Enter a Maximum of 10 Characters "
NewData = Left(NewData, 10)

Cancel = True
Response = acDataErrContinue
End If



what have i missed, it doesnt truncate anything
 
If Len(me!NewData) > 10 Or blkok = True Then

DisplayMessage "Text Too Long Enter a Maximum of 10 Characters "
me!NewData = Left(me!NewData, 10)

Cancel = True
Response = acDataErrContinue
End If

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

But I would use an input mask.

kh
 
Lloyd,

Multi-Column?

me.NewData.Column(1) = Left(me.NewData.Column(1), 10)

Subscripts start at 0 for the columns.

Or, is the name really NewData? Try using a breakpoint or MsgBox
to debug it.

Wayne
 
combo box Auto expanding

thanks guys for your help and suggestions. for some reason i could not get the column suggest to work. I changed the code slightly anyway. But do you guys know how to stop a combo box expanding. i set autoexpand to false it still expands though.
 

Users who are viewing this thread

Back
Top Bottom