Solved

String too long I guess!

Posted on 2002-03-26
4
275 Views
Last Modified: 2011-04-14
I use a procedure to create a listbox that shows all the queries in a database, so the user can select a query to run.

In testing, I ran into error 2176, something about "The text you are putting in this field is the wrong size, it must be either 255 or 2048 bytes...."  (I'm paraphrasing there!)

I set the list box for ROwSource=ValueList.

The DB I was using had LOTS of queries, so maybe the list was too big.  Anyway to handle this?  I suppose, the string I build containing queries, I could split into 200 char chunks, and display them thusly....And why do some queries come up with wierd names that I can't see in the DB window (things like ~sqqryWhatItIs).

Doug
0
Comment
Question by:dougp23
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
SE081398 earned 50 total points
ID: 6896641
I would tend to think that the value list can support up to 255 charactors. Dumb question but are you separating the values with semicolons?

another way to try this is by writing the names of the queries to a temp table and then set the controlsource of the list box to the temp table.  see if it displays.

with temptable
delete everything

keep the list box hidden(visible = false)
create a table with 1 field
loop through your querydefs and retrieve the names
write each name to the table

listbox.requery
listbox.visible= true

0
 
LVL 2

Expert Comment

by:mrt1
ID: 6896753
A list box can display a maximum of 255 entries, and each entry can be a maximum of 255 characters.
The character length shouldn't be an issue, because I don't think a query name can exceed 255 characters either.

The strange "~sqqry" entries are probably temporary querydefs that Access creates beind the scenes to help run your code. You should be able to filter out this entries using an SQL expression (e.g: SELECT *
FROM MSysQueries WHERE.....)
0
 
LVL 1

Author Comment

by:dougp23
ID: 6897075
Nice idea.  Yea, separated with commas.
I will do the table thing.  Thank you.
0
 
LVL 3

Expert Comment

by:SE081398
ID: 6897099
You're welcome.

If you need any more help doing this let me know.  I was brief in the explaination but I hope you got the idea.


SE


0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now