255 Character limit in Listbox

Vassago

Former Staff Turned AWF Retiree
Local time
Today, 01:11
Joined
Dec 26, 2002
Messages
4,748
I have been beating myself up over this for the past few days and have not found a feasible workaround yet, including searching this forum repeatedly.

I have a listbox which is tied to the below query:

SELECT tbl_csraws.priority, tbl_csraws.rawname, tbl_csraws.description, tbl_csraws.sqlcode, IIf(tbl_csraws.enabled=-1,'Enabled','Disabled') AS enabled, tbl_csraws.creator, tbl_csraws.createdate FROM tbl_csraws ORDER BY IIf(tbl_csraws.enabled=-1,'Enabled','Disabled') DESC , tbl_csraws.priority

The listbox only shows the second column to the user, and upon selecting one of the options, fills in text boxes on my form for the remaining information. The description field is a memo field on the table, but when a user selects an option from the list box where the description is greater than 255 characters in length, it cuts the remaining amount off, so if they save the changes without replacing the removed characters, it will cause problems with my database. Has anyone found a workaround for this problem?

Thanks!

Vassago
 
Vassago said:
I have been beating myself up over this for the past few days and have not found a feasible workaround yet, including searching this forum repeatedly.

I have a listbox which is tied to the below query:

SELECT tbl_csraws.priority, tbl_csraws.rawname, tbl_csraws.description, tbl_csraws.sqlcode, IIf(tbl_csraws.enabled=-1,'Enabled','Disabled') AS enabled, tbl_csraws.creator, tbl_csraws.createdate FROM tbl_csraws ORDER BY IIf(tbl_csraws.enabled=-1,'Enabled','Disabled') DESC , tbl_csraws.priority

The listbox only shows the second column to the user, and upon selecting one of the options, fills in text boxes on my form for the remaining information. The description field is a memo field on the table, but when a user selects an option from the list box where the description is greater than 255 characters in length, it cuts the remaining amount off, so if they save the changes without replacing the removed characters, it will cause problems with my database. Has anyone found a workaround for this problem?

Thanks!

Vassago


I'm not sure I can do this guy justice, but the one that built our database disected the string and placed in multiple records if over 255 char.

Here is the code below to show you what he did.

Code:
While intLength > 0
    
        If intLength > 255 Then
            strStringToLoad = Left(strCleanDescription, 255)
            strCleanDescription = Right(strCleanDescription, (intLength - 255))
            intLength = intLength - 255
        Else
            strStringToLoad = strCleanDescription
            intLength = 0
        End If

I can send you more if you like, but you have to ask me. I can't completely explain it, but I am sure you can understand what he did.
 
Yeah, I came to that conclusion too, unfortunately, it's not going to work correclty because some of these memo fields may be longer than that, so there would be a lot of coding and way too complicated for what it's worth.

I found another solution, but it's going to involve completely recoding my form, which is depressing.

Thanks for your help!
 

Users who are viewing this thread

Back
Top Bottom