Full Version: Can You Bind A Listbox To A Recordset Object ... In Acc2000
UtterAccess Forums > Microsoft® Access > Access Forms
niesz
Title says it all.
'd like to bind a recordset object to the rowsource of a listbox in ACC2000. This is to circumvent the 2048 character limit of a Value List setting.
ACC2003 and after has a MyListbox.Recordset property, but no such animal in 2000.
Any ideas?
LPurvis
Hi Walter
The ability to bind list controls to recordset began in Access 2002. :-s
It's Callback time I'm afraid! :-s
(Or dump the recordset values into a temporary/work table and bind to that - but the progressive nature of such insertions from a recordset will likely make it a slow affair.)
Cheers.
niesz
I've got no "temp table" either ... (ADP) and I'd rather not create objects on the server.
If you could be so kind as to point me to a Callback example, I'd surely be your friend forever. wary.gif
LPurvis
Comme ca?
http://access.mvps.org/access/forms/frm0049.htm
I must be way cool to make friends forever that easily. :-D
hough they work just fine - I never really much cared for callbacks personally. Perhaps one of my very few irrational development decisions. lol
I was a happy man when recordset binding came around.
HAs an aside, do you find ADPs under 2000 to be all you'd want? Obviously never having been a real implementor of them I can't say for sure - but I've understood them to improve subsequently. (For example form recordset binding got better after 2000. Another occasion of a lack of temporary tables workaround.)
Cheers
niesz
I've always bound forms to Tables, Views, or SPs. I have never, ever had the need to bind a recordset to a form. (I'd probably be looking up some of your examples if I did!)
The project that I'm working on now (in my spare time) is actually to overcome some of the failings of an Access 2000 ADP bound to a SQL Server 2008 datasource.
What I would like to create is a form that could be imported into any type/version project that would mimic the Database Window. That way I can control how objects open and what the default views are for objects no matter what silliness Microsoft comes up with.
Oenvision a single form that would stay open during the development process that allows me to work with any object (be it on a SS BE or an Access BE/FE).
I ran into a snag trying to get all the object names loaded into a listbox, because the string it creates was too long to stuff into a listbox rowsource.
niesz
So I guess to directly answer your question, ... I can do everything I need to do with Access 2000 ADPs.
The only reason I stuck with 2000 over 2003 is because there used to be a few holdouts of employees who were still using ACC2000 and they couldn't run 2003 ADEs.
That has recently changed, and I may find myself moving to 2003 to be the platform of choice.
Ocannot see me moving to anything beyond that, because I despise the development environment. I can't find anything or be productive in the least.
The last DB I built, I build first using SS2008. I actually downgraded it to 2000 to meet some deadlines. There would have been no way I could have accomplished what I did using 07/10.
niesz
I did get it to work!! I didn't need multiple columns, so I ended up using the single column example from the Help files. I never knew you could populate a listbox that way. <
might pick your brain later on for a couple of more ideas ...
(Hint: like, ... what is the best method for getting an ordered list of Form Names into a listbox? ... I was using the AllForms collection, but it isn't ordered. So I was thinking I might have to dive into a system table ... Then I remembered there isn't any in an ADP! So I'm thinking I may end up sorting an array or building a recordset out of the results and sorting it.)
LPurvis
Oooh using recordsets to easily sort values. Love it. :-)
BananaRepublic
Walter -
WIW, I'd have never thunk callback was supported for this context. I always though it was simply table/query, value or field, and no more. Glad to have learned this trick anyway.
HAs for your question... Surely you could do a query on the SYS.* views and do an ORDER BY on it, no?
LPurvis
>> Surely you could do a query on the SYS.* views and do an ORDER BY on it, no?
For Access Form names? ;-)
BananaRepublic
Why, of course! There's undocumented feature, Sys.Forms that allow you to list all names of Access forms. Surely you of all person know that!
wary.gif
I guess in that case, an ADO recordset made out of thin air, populated with AllForms members' name and Sort applied is in the order, throw it in a form that looks like a fake listbox and voila!
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.