By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,974 Members | 1,913 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,974 IT Pros & Developers. It's quick & easy.

Varchar2 fields limit

P: n/a
I am using Oracle as a backend and have a field set as Varchar2(2000).
The problem i have is access interprets this as a memo field and
allows the user to type more than 2000 characters but does not store
the excess characters beyond 2000, giving the user the false sense of
security that what they are typing beyond 2000 characters is being
saved, which is not the case. I want to prevent the user from typing
more than 2000. How do i do this?
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On 30 Jun 2004 03:50:54 -0700, mi******@boh.com (Mitchell Thomas)
wrote:

You could write some code in the <control>_Change event, to check the
length of the Text property.

-Tom.

I am using Oracle as a backend and have a field set as Varchar2(2000).
The problem i have is access interprets this as a memo field and
allows the user to type more than 2000 characters but does not store
the excess characters beyond 2000, giving the user the false sense of
security that what they are typing beyond 2000 characters is being
saved, which is not the case. I want to prevent the user from typing
more than 2000. How do i do this?


Nov 13 '05 #2

P: n/a
Tom van Stiphout <no*************@cox.net> wrote in message news:<at********************************@4ax.com>. ..
On 30 Jun 2004 03:50:54 -0700, mi******@boh.com (Mitchell Thomas)
wrote:

You could write some code in the <control>_Change event, to check the
length of the Text property.

-Tom.

I am using Oracle as a backend and have a field set as Varchar2(2000).
The problem i have is access interprets this as a memo field and
allows the user to type more than 2000 characters but does not store
the excess characters beyond 2000, giving the user the false sense of
security that what they are typing beyond 2000 characters is being
saved, which is not the case. I want to prevent the user from typing
more than 2000. How do i do this?

thanks for your idea. I wrote this code, but it does not work if the
user hits Shift-F2 to expand the text box to type in text. The code i
wrote is below. Any other ideas?

Dim LengthComment As Variant
LengthComment = Len(Me.txtComments)
If LengthComment > 2000 Then
MsgBox "You have hit your limit of 2000 characters!"
Else
End If
Nov 13 '05 #3

P: n/a
On 30 Jun 2004 13:47:49 -0700, mi******@boh.com (Mitchell Thomas)
wrote:

Punish them after they come back from the Zoom window. Also note the
use of the Text property.

If you really want to control the Zoom window, you will have to write
your own.

Private Sub CategoryName_Change()
Const MAX_LENGTH = 5
Dim LengthComment As Integer
LengthComment = Len(Me.CategoryName.Text)
If LengthComment > MAX_LENGTH Then
MsgBox "You have hit your limit of " & MAX_LENGTH & " characters!"
CategoryName = Left$(CategoryName.Text, MAX_LENGTH)
Else
End If
End Sub

-Tom.

Tom van Stiphout <no*************@cox.net> wrote in message news:<at********************************@4ax.com>. ..
On 30 Jun 2004 03:50:54 -0700, mi******@boh.com (Mitchell Thomas)
wrote:

You could write some code in the <control>_Change event, to check the
length of the Text property.

-Tom.

>I am using Oracle as a backend and have a field set as Varchar2(2000).
> The problem i have is access interprets this as a memo field and
>allows the user to type more than 2000 characters but does not store
>the excess characters beyond 2000, giving the user the false sense of
>security that what they are typing beyond 2000 characters is being
>saved, which is not the case. I want to prevent the user from typing
>more than 2000. How do i do this?

thanks for your idea. I wrote this code, but it does not work if the
user hits Shift-F2 to expand the text box to type in text. The code i
wrote is below. Any other ideas?

Dim LengthComment As Variant
LengthComment = Len(Me.txtComments)
If LengthComment > 2000 Then
MsgBox "You have hit your limit of 2000 characters!"
Else
End If


Nov 13 '05 #4

P: n/a
Tom van Stiphout <no*************@cox.net> wrote in message news:<9m********************************@4ax.com>. ..
On 30 Jun 2004 13:47:49 -0700, mi******@boh.com (Mitchell Thomas)
wrote:

Punish them after they come back from the Zoom window. Also note the
use of the Text property.

If you really want to control the Zoom window, you will have to write
your own.

Private Sub CategoryName_Change()
Const MAX_LENGTH = 5
Dim LengthComment As Integer
LengthComment = Len(Me.CategoryName.Text)
If LengthComment > MAX_LENGTH Then
MsgBox "You have hit your limit of " & MAX_LENGTH & " characters!"
CategoryName = Left$(CategoryName.Text, MAX_LENGTH)
Else
End If
Thanks for the code, it works great. I actually have two varchar2
fields both with a limit of 2000. If the user uses the zoom window
and exceeds the 2000 limit, i would like to copy the excess characters
into the 2nd varchar2 field, instead of erasing it. Can you tell me
how to do that, i was trying to use the mid function but could not
figure out how many characters to copy... End Sub

-Tom.

Tom van Stiphout <no*************@cox.net> wrote in message news:<at********************************@4ax.com>. ..
On 30 Jun 2004 03:50:54 -0700, mi******@boh.com (Mitchell Thomas)
wrote:

You could write some code in the <control>_Change event, to check the
length of the Text property.

-Tom.
>I am using Oracle as a backend and have a field set as Varchar2(2000).
> The problem i have is access interprets this as a memo field and
>allows the user to type more than 2000 characters but does not store
>the excess characters beyond 2000, giving the user the false sense of
>security that what they are typing beyond 2000 characters is being
>saved, which is not the case. I want to prevent the user from typing
>more than 2000. How do i do this?

thanks for your idea. I wrote this code, but it does not work if the
user hits Shift-F2 to expand the text box to type in text. The code i
wrote is below. Any other ideas?

Dim LengthComment As Variant
LengthComment = Len(Me.txtComments)
If LengthComment > 2000 Then
MsgBox "You have hit your limit of 2000 characters!"
Else
End If

Nov 13 '05 #5

P: n/a
On 1 Jul 2004 18:34:51 -0700, mi******@boh.com (Mitchell Thomas)
wrote:

How about:
MyTextbox2.Value = Mid$(MyTextbox1.Text, MAX_LENGTH+1)

-Tom.
Tom van Stiphout <no*************@cox.net> wrote in message news:<9m********************************@4ax.com>. ..
On 30 Jun 2004 13:47:49 -0700, mi******@boh.com (Mitchell Thomas)
wrote:

Punish them after they come back from the Zoom window. Also note the
use of the Text property.

If you really want to control the Zoom window, you will have to write
your own.

Private Sub CategoryName_Change()
Const MAX_LENGTH = 5
Dim LengthComment As Integer
LengthComment = Len(Me.CategoryName.Text)
If LengthComment > MAX_LENGTH Then
MsgBox "You have hit your limit of " & MAX_LENGTH & " characters!"
CategoryName = Left$(CategoryName.Text, MAX_LENGTH)
Else
End If


Thanks for the code, it works great. I actually have two varchar2
fields both with a limit of 2000. If the user uses the zoom window
and exceeds the 2000 limit, i would like to copy the excess characters
into the 2nd varchar2 field, instead of erasing it. Can you tell me
how to do that, i was trying to use the mid function but could not
figure out how many characters to copy...
End Sub

-Tom.

>Tom van Stiphout <no*************@cox.net> wrote in message news:<at********************************@4ax.com>. ..
>> On 30 Jun 2004 03:50:54 -0700, mi******@boh.com (Mitchell Thomas)
>> wrote:
>>
>> You could write some code in the <control>_Change event, to check the
>> length of the Text property.
>>
>> -Tom.
>>
>>
>> >I am using Oracle as a backend and have a field set as Varchar2(2000).
>> > The problem i have is access interprets this as a memo field and
>> >allows the user to type more than 2000 characters but does not store
>> >the excess characters beyond 2000, giving the user the false sense of
>> >security that what they are typing beyond 2000 characters is being
>> >saved, which is not the case. I want to prevent the user from typing
>> >more than 2000. How do i do this?
>
>
>thanks for your idea. I wrote this code, but it does not work if the
>user hits Shift-F2 to expand the text box to type in text. The code i
>wrote is below. Any other ideas?
>
>Dim LengthComment As Variant
>LengthComment = Len(Me.txtComments)
>If LengthComment > 2000 Then
> MsgBox "You have hit your limit of 2000 characters!"
>Else
>End If


Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.