Apply properties to a list

A

accessuser1308

I currently have a table that contains hundreds of entries by name. I would
like to create a form on which I can select several of these names(not
necessarily grouped together). I would like to enter additional data on the
form and have all of it stored with each of the names selected. Can this be
done using a list box or a tree. If so, how would I do this.

Thank You
 
T

Tom Wickerath

Yes, it could be done using a multiselect listbox, with some custom VBA code.
You would need to create an update query in VBA code, where the criteria was
determined by iterating the selected items property of the list box.

As a precursor to learning how to do this, you may want to concentrate on
learning how to create a SELECT statement in VBA code, where the WHERE
condition is created on-the-fly by iterating the selected items in a list
box. Your next task, after you had a through understanding of how such code
worked, would be to convert your SELECT statement into the appropriate UPDATE
statement. You would likely pick some values off of one or more text boxes on
the form for the data that you wanted to update.

Here is an example that uses the elements found in the periodic table in a
multiselect list box, to build the WHERE clause of a SQL statement on-the-fly:

http://home.comcast.net/~tutorme2/samples/elements.zip


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
I

IRS Intern

Warning; Tom Wickerath is a cry baby database pussy and you shouldn't
listen to him for anything

go and talk to someone that knows SQL Server, kids
 
Top