Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text box cuts off entry

Status
Not open for further replies.

dcushnie

Programmer
Feb 2, 2005
28
CA
I am having a problem with a text box on a form.
If you type to many characters into the text box (about 500 or more) when it is saved to the database it will cut off the entry and throw in some weird characters at the end.

The field type in the table is a memo field.
And if i type the entry directly into the table instead of using the form it will take without a problem.

I have tried Can Grow and it didn't do anything.
And I don't have an Input Mask on the text box.

Anyone know what to do???
 
I was unable to duplicate your problem using Access 2003, even when typing (or pasting) 2 or 3 thousand characters into a memo field textbox.
Are you seeing the 'weird' characters in the textbox or in the table or both? And are they consistently the same weird characters?

traingamer
 
The weird characters appear after you hit the save button the runs a query adding the data to the table.
Then if you try to view the data on a different form it comes out truncated with weird characters at the end and if i look at it in the table it is also truncated with weird characters at the end.

They aren't always the same weird characters.
Here are some examples of them:
????????r??Ÿ?

 
This is the code from clicking on the add button:

Private Sub AddEntry_Click()
If (IsNull(Me.txtTitle.Value) Or Me.txtTitle.Value = "") Then ' if no title entered
MsgBox "Please enter a title", vbOKOnly, "Entry Error"
ElseIf (IsNull(Me.txtProcess.Value) Or Me.txtProcess.Value = "") Then ' if no contents entered
MsgBox "Please enter a process", vbOKOnly, "Entry Error"
Else
DoCmd.OpenQuery ("clearHits") ' clears previous search results
Dim db As DAO.Database ' Allows us to open Hits table as a recordset
Dim rs As DAO.Recordset ' Allows us to count entries in Hits table
Form_Container.txtTitle.Value = Me.txtTitle.Value ' give values to container
Form_Container.txtEntryID = Me.txtEntryID.Value
DoCmd.OpenQuery ("SearchforSame") ' searchs for entries with same title
Set db = CurrentDb
Set rs = db.OpenRecordset("Hits")
If (rs.RecordCount = 0) Then
DoCmd.OpenQuery ("addNewEntry")
DoCmd.Close
DoCmd.OpenForm ("DisplayEntry")
Else
MsgBox "An entry with this title already exists", vbOKOnly, "Entry Error"
End If
End If
End Sub


Here is the clearhits query:

DELETE *
FROM Hits;


Here is the searchForSame query:

INSERT INTO Hits ( entryID, title )
SELECT entries.entryID, entries.title
FROM entries
WHERE LCASE(entries.title)=LCASE(Forms!Container!txtTitle) And entries.entryID<>Forms!Container!txtEntryID;


Here is the addNewEntryQuery:

INSERT INTO entries ( entryID, title, createdBy, dateCreated, process )
SELECT Forms!NewEntry!txtEntryID, Forms!NewEntry!txtTitle, Forms!NewEntry!txtCreatedBy, Forms!NewEntry!txtDateCreated, Forms!NewEntry!txtProcess;



Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top