Solved

access 2003 limit character length in MSOTextBox in page forms

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

948 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

20 Experts available now in Live!

Get 1:1 Help Now