Solved

access 2003 limit character length in MSOTextBox in page forms

Posted on 2009-06-29
4
447 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

726 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