Solved

access 2003 limit character length in MSOTextBox in page forms

Posted on 2009-06-29
4
429 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
LSMConsulting, do you know what the max length can be for a memo field setting?
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

14 Experts available now in Live!

Get 1:1 Help Now