Solved

text boxes

Posted on 1998-08-27
1
109 Views
Last Modified: 2010-04-30
Hello
I want my text boxes to have the same lenght as the database fields and don't let the user to write after that lenght so it doesn't give me the error that I exceed the lenght of the field.
Can you help me?

Thanks
Alberto
0
Comment
Question by:asimoes
1 Comment
 
LVL 14

Accepted Solution

by:
waty earned 200 total points
ID: 1431268
The first solution
You have to set all your textbox.maxlength to the length of your field :

tbTextbox.MaxLength = Fields(4).FieldSize

The second solution
You can take all the maximum needed left character of your textbox in your record. This will ignore extra characters :

Fields(4).Value = Left(tbTextBox.Text, Fields(4).FieldSize)

NB : Adapt the code for your needs.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now