Setting property too long

S

State Troopers

Hi there,
On my form I have a textbox for input, and a textbox which is coded to bring
up certain fields in a table.
For instance, the textbox is coded so that on form load it loads all data
from table PEOPLE and then from that it looks in the first field(NAME) for
"John". It then loads all the comments for "John".

the problem I am having is that when the textbox loads it gives me an error:
The setting for this property is too long.

The table values are all stored as memo fields.
The text which I would like displayed is 2830 characters long.

If needed, I can post the code for the texbox.

Thanks
-State
 
S

State Troopers

This is the function which grabs the required data.
---------------------------------------------------------------------------

Dim strType As String
Dim strDir As String
Dim dbMyDB As New ADODB.Connection
Dim rsMyRS As New ADODB.Recordset
Dim strTablename As String

Const adCmdTable = -1

'set the catagory type
strType = "Investigation"

txtDir.SetFocus
strDir = txtDir.Text

'-------------
'open the database, and then open the table within the specified database
'-------------
dbMyDB.Open "Provider = Microsoft.Jet.OLEDB.4.0;" & "Data
Source=V:\QualMgt\DIRS\TEST\DIR.mdb"
strTablename = "tblComments"
rsMyRS.Open strTablename, dbMyDB, adOpenKeyset, adLockOptimistic,
adCmdTable

rsMyRS.MoveFirst
Do Until rsMyRS.EOF 'do until the process has reached the end of the table

'If the DIR # is equal to the one the user entered, and the catagory is
equal to "investigation then
If rsMyRS.Fields!DIR = strDir And rsMyRS.Fields!Catagory = strType Then
txtCom_In.SetFocus
'Check to see if the box is empty
If txtCom_In.Text = "" Then
'if its empty, enter the new data
txtCom_In.Text = rsMyRS.Fields!DATE & " " &
rsMyRS!Comment & " //" & rsMyRS.Fields!USER
rsMyRS.MoveNext
Else
'if it isnt empty, go to the next line
txtCom_In.Text = txtCom_In.Text & vbCrLf &
rsMyRS.Fields!DATE & " " & rsMyRS!Comment & " //" & rsMyRS.Fields!USER
rsMyRS.MoveNext
End If
Debug.Print
Else
rsMyRS.MoveNext
End If
Loop

'if we are at the end of the table
If rsMyRS.EOF Then
'do nothing
End If



Cheers
-State
 
S

State Troopers

For future users.

The problem here is that Visual Basic only allows 64kb of memory usage.
This error usually means you have too many processes going on in your code.
Which seems to be my problem.

Hope this helps.
Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top