textbox data type

  • Thread starter Thread starter Martin Payne
  • Start date Start date
M

Martin Payne

I have a form with a textbox and an OK button. When the OK button is
clicked a procedure is executed to insert the value in the textbox into
a table.

My problem is that only the first 255 characters of the string in the
textbox are stored in the table. The relevant field data type is memo.
And, I have tried both textbox.value and textbox.text to retrieve the
string from the textbox.

Any ideas?

Thanks,
Martin
 
Make sure there is nothing in the Format property of the text box on the
form, and nothing in the Format property of the field in the table.

If that does not solve the problem, post the SQL statement you use to insert
the record.
 
I just checked, neither my textbox nor the table field have a format
applied.

Here is a fragment of the latest version of my code. As you can see, I
am being extra cautious with the way I am getting the string from the
textbox (as mentioned earlier, I've tried both tmpTextBox.Value and
tmpTextBox.Text).

Dim conn As New ADODB.Connection
Set conn = CurrentProject.Connection
Dim tmpTextBox As TextBox
Set tmpTextBox = Me.Controls!txtNotes
tmpTextBox.SetFocus
Dim strNotes As String
strNotes = tmpTextBox.Text
strNotes = Replace(strNotes, "'", "")

conn.Execute "UPDATE TestCycle SET cycActTime = " &
Me.Controls!txtActTime.Value & _
", cycNotes = '" & strNotes & "', cycStatus = '" & _
Me.Controls!cmboStatus.Value & "', cycNotesExist = " &
notesExist & _
" WHERE cycName = '" & Me.Controls!txtTestCycle.Value & _
"' AND tsId = " & Me.Controls!txtTestSet.Value
 
For debugging, create a string so you can track what's going on:
Dim strSql As String
strSql = "UPDATE TestCycle...
Debug.Print strSql

That will let you see in the Immediate Window (ctrl+G) whether the string
contains the intended data or not.
 
Back
Top