Access 2007 win 7 64 problems with textbox truncating data

dogdays

Active Member
Joined
Apr 28, 2008
Messages
434
Office Version
  1. 2007
I have a memo field I want to display in a textbox. The data is truncated at 256 bytes.
Is it possible to increase the max display chars for a textbox?

tia Jack
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
How are you getting the data into the field? Cut and Paste? That can cause truncation.
Is the textbox bound to a memo field? If not, the field limit will be 255 characters. Or is it not bound at all? A textbox can hold about 64k of characters if it's a memo field.
 
Upvote 0
Currently I am populating the textbox from an entry in a listbox.
The textbox is unbound. How do I make the textbox a memo field(Your last sentence)

Jack?
 
Upvote 0
Currently I am populating the textbox from an entry in a listbox.
OK, that's kinda strange. Why do that as opposed to just getting the selected listbox value?

Regardless of my question, now I don't really know what you're doing.
The textbox has to be bound to a memo field in a table (now called a long text type, I guess) in order to store more than 255, but I don't understand if your problem is that you can't save it with more than 255, or just can't get that much to go into it into the first place. Is the form control bound to a table field or is it unbound? If unbound, was it ever bound to a short text field? If so, delete it and add a new one - I've read that the property can be "grandfathered" if you reuse the control on a different text data type of field.
 
Upvote 0
Here is what I am trying to do,.
Using a state provided voter registration file (about a million voters) I am trying to help candidates
for office using the voter registration file. One of the key parts is allowing the candidate to subset the DB
e.g. candidate is interested only in the voters in his district. The candidate may then subset into other subsets
e.g. republican females in an age range. I am saving the queries the candidate has used for future reuse.
The table is tblSavedQueries
Code:
    "nIdentity",                "Long",           4,   ""
    "nElectionYear",          "Integer",        2,   ""
    "dtDateRun",              "Date/Time",    8,   "date first run (system supplied)"
    "tQueryName",            "Text",        250, "user supplied name"
    "mOpenArgs",             "Memo",        0,   "for report/labels etc schema in global"
I populate the listbox with the 5 fields, the lisbox entry for the entry mOpenArgs truncates to 255 so I cannot use that to populate the textbox.
So I tried this
Code:
    ' populate text box with a memo field
    Set qdf = CurrentDb.QueryDefs("qryBindSavedQueriesMemoField")
    strQuery = qdf.SQL                     'original Query's SQL
    strQuery = strQuery & Left(strQuery, Len(strQuery) - 1)
    strQuery = strQuery & " WHERE nIdentity = " & Me.lsbSavedQueries.Column(0)
    Me.cmdCloseQuerySQL.Visible = True
    Me.txtQuerySQL.Visible = True
    Me.txtQuerySQL.SetFocus
    Me.txtQuerySQL.ControlSource = strQuery
    Me.txtQuerySQL.Requery
    Me.cmdCloseQuerySQL.SetFocus
the textbox shoes #NAME.
the query is
Code:
SELECT tblSavedQueries.mOpenArgs
FROM tblSavedQueries;
 WHERE nIdentity = 122
I hope this makes sense.
 
Upvote 0
I just don't get why you're using a listbox - it's not a good choice for memo/long text type fields. As far as I recall, you cant even display more than one row of text in a listbox row, so even if you get it to work, you won't see it all. It seems you're putting (or in the case of a listbox, trying to put) all sorts of long strings into textboxes - kind like putting water into a paper bag. You might get all of it to fit, but it's not a great solution. Some of your info is still a bit lacking (such as whether or not forms/controls are bound). As for the #Name error when applying a rowsource to a textbox, you cannot do this for an unbound texbox. The control has to be on a form that has a record source, and it has to be a field from that recordsource. To do what you are trying to do, the textbox has to use the DLookup function. That should take care of the error message, but I still don't know how to help you with the truncation.
 
Last edited:
Upvote 0
Micron, thanks for the help. I was trying to display the saved query to help the user remember
what he had done. Since almost (if not all) of the users will not understand SQL I just dropped the idea.

Jack
 
Upvote 0
you could store the search criteria for the user and reload it when needed. The keywords would be more useful than the sql.
 
Upvote 0

Forum statistics

Threads
1,221,813
Messages
6,162,117
Members
451,743
Latest member
matt3388

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top