|
-
Jun 8th, 2006, 08:42 PM
#1
Thread Starter
New Member
Listbox load question
I use Access 2003 with VBA and managed to create a dual list box feature that allows me to pick from left and copy to right. I set it up to copy the items instead of moving them and I can do multiple selections. It works great for lists up to several hundred, but is sluggish at 1100 or so names.
I feed the results to a table so I can use it in a query to limit the matching records in the selection. That was easier than creating a humongous SQL statement.
It works pretty well until I have a list with embedded commas in the text. The additem function splits the entry at the comma. Last name, first name turns into last name on one row and first name on the next.
Does any one have a way to tell additem to ignore embedded commas?
I would also be happy to share this routine should anyone want a copy.
Thanks.
-
Jun 9th, 2006, 03:39 AM
#2
Re: Listbox load question
 Originally Posted by kfinpgh
The additem function splits the entry at the comma.
It shouldn't, and in fact I just tried it and it didn't. Perhaps there is some other (non visible) data embedded in the string which is causing your problem, eg a linefeed or carriage return etc
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
-
Jun 9th, 2006, 08:07 AM
#3
Thread Starter
New Member
Re: Listbox load question
I am using VBA, which may behave differently than VB6. If there were other characters in the field, Access would split the contents of the field in other operations.
-
Jun 9th, 2006, 09:33 AM
#4
Re: Listbox load question
Access VBA question moved to Office Development
-
Jun 19th, 2006, 10:14 AM
#5
Thread Starter
New Member
Re: [RESOLVED]Listbox load question
I used findandreplace() to change the comma to " and ". I reverse the process when the listbox contents are used in a multi-item selection table. That turns the " and " back into the comma.
Works OK for a small list, but 11 names can take a while.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|