Solved

access 2003 limit character length in MSOTextBox in page forms

Posted on 2009-06-29
4
453 Views
Last Modified: 2013-11-28
*FYI, i am a beginner at this.

I have created a page within Access and saved it as an HTM for users to be able to input data through a webpage interface. This data is then feed unto a table.  However, I have a field for notes that the user is required to fill in. This Notes field is an MSOTextBox. The issue I am having is that the max length for characters within the field in the table is 255 characters. When a user is typing notes in more than that, they get an error. I need to resolve this error by either doing two things.
1. Limit the field on the page to 255, so the user can not type more than 255 characters.
Or
2. When the error box comes up, a way to put a note within to tell the user to limit their characters.

Additionally, does anyone know how to add a counter that a user can see so they know how many characters they have used and still have available?


0
Comment
Question by:chris2009
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 400 total points
ID: 24738228
Do you want to allow users to enter more than 255 characters? If so, change the Datatype of the underlying field to Memo.

Is this a Data access page (i.e. DAP)? If so, you'll find little help with issues with that format. MS has long since stopped support for the format, and it never really was a "finished" product IMO.
0
 
LVL 8

Assisted Solution

by:lharrispv
lharrispv earned 100 total points
ID: 24738263
To limit the number of characters entered in the browser edit the HTML so the text box has the maxlength attribute:

<input type="text" name="blah" size="25" maxlength="255">

Using VBA in access you can count and display the number of chars left li doing what I puit in the code snippet

Private Sub Text1_Change()
    Text2 = 255-Len(Text1)
End Sub

Open in new window

0
 
LVL 8

Expert Comment

by:lharrispv
ID: 24738273
Oh and also in the VBA you can build an event handler that fires a msgbox when the error occurs that informs the users they exceeded the max chars.

You can google on the various things to see exactly how to execute.  The info I gave should get started though.
0
 

Author Comment

by:chris2009
ID: 24738466
LSMConsulting, do you know what the max length can be for a memo field setting?
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

729 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