473,406 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Varchar2 fields limit

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
5 2644
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Wm | last post by:
I have three phone/fax number fields in a database that people are spamming with text info (marketing hype B.S.) and I want to figure out how to clean up the info and then limit it in the future. I...
0
by: Tillu | last post by:
One of the column in a new table can be ename - varchar2(20) or hase_code_ename - number(11) – Hash Code generated by JAVA. We are going to create non-unique index on this column as one frequent...
1
by: Mat Hess | last post by:
We are currently developing a new application. In this application, we have a table which will hold a large number of rows, where many text fields (one text field per row) will be stored. The users...
0
by: Sven Mayer | last post by:
Assume a database (e.g. Oracle) field is declared as a) NUMBER (length=10) b) NUMBER (length=26) c) VARCHAR2 (length=1) d) VARCHAR2 (length=50) e) DATE How do I retrieve the contents from...
14
by: hilz | last post by:
Hi all, What is the equivalent of VARCHAR2 in access? thanks hilz
1
by: ian.davies52 | last post by:
I'm having a problem running a query. I get the "too many fields" error message, but I only have 162 fields in the query and I thought the limit was 255. The problem query (Query1) is based on...
12
by: M G Henry | last post by:
I have a tabbed form that contains 12 different "pages" and when I try and run the form I get the error message too many fields defined --- which I believe is the 255 field limit in the record...
5
by: moorthyvisu | last post by:
Hi, I have a below scenario: Table name : ClientCode. Fields are : startcode varchar2(20) & endcode varchar2(20); The values in these two fields should not overlap. For Ex:
3
by: ryan.paquette | last post by:
In the table there are 2 fields in which I wish to limit (i.e. No Duplicates) Although I do not want to limit them to "No Duplicates" separately. I need them to be limited to "No Duplicates" as...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.