Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

storing multiple list selections in access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Galliard - 19 Jan 2008 00:08 GMT
i have 2 tables, table a and table b.  is it possibile for a control
bound to table a (a list box, with multiple selections eneabled) to be
able to select multiple records from table b, and store them?
i.e. table A record 1 has table B records 1,2,3,4,8,12, and so on
selected
while Table A record 2 only has table B records 3, 8 and 15 selected,
and so on..
is there some way to store those selections within table A?

for those curious, i'm making a character sheet for an RPG.. table A
is the actual sheet, while B is the list of spells.. i'm looking for a
way to store which spells each character has on the sheet(A), using
the spell table (B) as the reference.  i'm looking at upwards of 50 or
so selections as well, so using multiple fields IE spell1, spell2,
spell3... is possibile, its not practical to do...

also, some way to put it to a report would also be handy.. i have it
set up so that i can print A and B fine, but i'm looking for a way to
print A, followed by B, but only the selections from B that were
picked in A

assistance and ideas much appreciated ^^
John W. Vinson - 19 Jan 2008 00:49 GMT
>i have 2 tables, table a and table b.  is it possibile for a control
>bound to table a (a list box, with multiple selections eneabled) to be
[quoted text clipped - 4 lines]
>and so on..
>is there some way to store those selections within table A?

No, and a multiselect listbox cannot be bound.

>for those curious, i'm making a character sheet for an RPG.. table A
>is the actual sheet, while B is the list of spells.. i'm looking for a
[quoted text clipped - 9 lines]
>
>assistance and ideas much appreciated ^^

This is a classic many to many relationship. Each character can master many
spells; each spell can be mastered by many characters. The proper way to do
this is to have THREE tables:

Characters
 CharacterID <Primary Key>
 CharacterName
 <other info about the character as an entity, e.g. species (Human, Orc,
Elf), EthicalNature (Lawful Good, Chaotic Evil), etc.>

Spells
 SpellID <Primary Key>
 Description <text>

Masteries
 CharacterID <who has mastered this spell>
 SpellID <what did they master>
 <other info about this character's mastery of this spell, such as level of
skill>

You would use a Subform to insert as many spells as needed for each character.

See the Northwind sample database Orders form for an example - the parallel
would be Orders = Characters, Products = Spells, OrderDetails = Masteries.

            John W. Vinson [MVP]
Galliard - 20 Jan 2008 18:01 GMT
On Jan 18, 4:49 pm, John W. Vinson
<jvinson@STOP_SPAM.WysardOfInfo.com> wrote:

> >i have 2 tables, table a and table b.  is it possibile for a control
> >bound to table a (a list box, with multiple selections eneabled) to be
[quoted text clipped - 47 lines]
>
>              John W. Vinson [MVP]

that worked almost exactly how i wanted it ^^

but is there a controlout there, or a way to make one, that looks
similar to the field selection controls in the wizards?  the one with
to list boxes and the set of arrows between them that moves the
selections back and forth?
John W. Vinson - 20 Jan 2008 21:19 GMT
>but is there a controlout there, or a way to make one, that looks
>similar to the field selection controls in the wizards?  the one with
>to list boxes and the set of arrows between them that moves the
>selections back and forth?

You'll need to program that yourself in VBA code, using the arrow buttons to
change the two listbox's RowSource queries and requery them. I suspect the
code to do so is out there somewhere but I can't quickly find it.

            John W. Vinson [MVP]
James A. Fortune - 21 Jan 2008 04:46 GMT
>>but is there a controlout there, or a way to make one, that looks
>>similar to the field selection controls in the wizards?  the one with
[quoted text clipped - 6 lines]
>
>              John W. Vinson [MVP]

In:

http://groups.google.com/group/comp.databases.ms-access/msg/26b8d590580190ca

I posted a link to TabOrder.zip.  TabOrder.zip has a form called
frmTabOrder that contains a subform and a listbox that send items to
each other when an item is clicked.  The Click code can be moved to
command buttons with bitmaps of arrows applied and can be modified to
use two listboxes.  Each button should make sure that item(s?) have been
selected in the appropriate listbox before attempting the move.

James A. Fortune
MPAPoster@FortuneJames.com
John W. Vinson - 21 Jan 2008 05:49 GMT
>In:
>
[quoted text clipped - 6 lines]
>use two listboxes.  Each button should make sure that item(s?) have been
>selected in the appropriate listbox before attempting the move.

Many thanks, James!

            John W. Vinson [MVP]
Rob Parker - 21 Jan 2008 06:47 GMT
Helen Feddema wrote an article on this topic in a recent Access Watch
column.  The article, and an example Access database with code to swap items
between two listboxes, is available from her website via the following link:

http://www.helenfeddema.com/Files/accarch172.zip

HTH,

Rob

>>but is there a controlout there, or a way to make one, that looks
>>similar to the field selection controls in the wizards?  the one with
[quoted text clipped - 7 lines]
>
>             John W. Vinson [MVP]
John W. Vinson - 21 Jan 2008 17:15 GMT
>Helen Feddema wrote an article on this topic in a recent Access Watch
>column.  The article, and an example Access database with code to swap items
[quoted text clipped - 3 lines]
>
>HTH,

Thanks, Rob - bookmarked.

            John W. Vinson [MVP]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.