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
Solved

access 2003 limit character length in MSOTextBox in page forms

Posted on 2009-06-29
4
444 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
  • 2
4 Comments
 
LVL 84

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

861 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