|
-
Apr 25th, 2005, 06:48 AM
#1
Thread Starter
Fanatic Member
Is there a better way to do this?
I have a listbox on my form that is populated by data from Microsoft Access using a query/recordset. This query returns about 6 fields which include employee "FirstName" and "LastName" and "ID" which is a unique identifier.
Through code I make the entries in the listbox look like this...
Cruise, Tom
Gates, Bill
Gretzky, Wayne
Nicholson, Jack
and so on. This works perfectly.
I then allow the user to drag & drop names from this listbox onto a schedule on the same form that consists of about 55 textboxes.
The problem is that the listbox only contains the first & lastname of the employee because that's all I want the user to see. However, once a name is dropped into a textbox I need more information than simply lastname or firstname. I need the ID as well.
What I'm currently doing works fine but there has to be a better way.
Right now, once a name is dropped into a textbox I take the last name and do a ".Find" to find the record in the recordset I'm looking for. Then I have access to all the other info I need. It just seems silly to be manipulating strings and constantly searching for records. Maybe this is a good way, I don't know.
-
Apr 25th, 2005, 06:54 AM
#2
Fanatic Member
Re: Is there a better way to do this?
Store the ID into the listbox's ItemData, then use that for more precision
-
Apr 25th, 2005, 06:58 AM
#3
Re: Is there a better way to do this?
Regardless of how you do it, searching for information relevant to the name being dropped is going to have to occur, so I don't see anything wrong with how you are doing it.
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
|