Solved

String too long I guess!

Posted on 2002-03-26
4
306 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

808 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