Re: Populating a list
- From: Kass <Kass@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 6 Jun 2006 16:53:01 -0700
Crystal,
Thanks for your quick responce. I want to look at the other form
suggestions you listed at the top of the page, but I couldn't get the links
to work. There was an error message indicating that server 119 is no longer
available or something like that. Can you advise...perhaps I am just not
accessing this correctly.
I think your multi-select list box may be what I'm looking for, however I'm
going to have to do some studying. I'm not well versed in SQL. I may have
to work on this and get back to you. In the mean time, if you know how I can
get to the info you sent, I'm very interested in learning all I can. I
really want this project to work for the people I'm building this database
for... it will save them an enormous amount of time and redundancy if I can
just figure this out!
I need a bigger brain! :-)
Thanks for your help!
Kass
"strive4peace" <"strive4peace2006 at yaho" wrote:
Hi Kass,.
look here for ideas on other things you can do with your form:
news://msnews.microsoft.com:119/1149538886.072984.248900@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
news://msnews.microsoft.com:119/uMnyDySiGHA.3884@xxxxxxxxxxxxxxxxxxxx
news://msnews.microsoft.com:119/Odvb5qYiGHA.3780@xxxxxxxxxxxxxxxxxxxx
for choosing multiple activities, consider using a
multi-select listbox , then you can loop thru the listbox
selected items and construct a WHERE clause for an SQL
statement that you can write to show all kit parts
here is some code for constructing a the WHERE clause from a
multi-select listbox for an SQL statement
'~~~~~~~~~~~~~~~~~~~~~
Dim varItem As Variant
Dim mWhere As String
mWhere = ""
For Each varItem In me.listbox_controlname.ItemsSelected
'delete the line that doesn't apply
'for text
mWhere = mWhere & "'" _
& me.listbox_controlname.ItemData(varItem) & "', "
'for numbers
mWhere = mWhere _
& me.listbox_controlname.ItemData(varItem) & ", "
Next varItem
if len(mWhere ) > 0 then
mWhere = "[Field_Name] IN (" & mWhere
'remove comma from the end and add a parenthesis
mWhere = left(mWhere ,len(mWhere )-2)) & ")"
end if
'then, if you have other criteria, you can put code here
'~~~~~~~~~~~~~~~~
you can use the same code to construct a string to use for
the WHERE parameter of an OpenReport action
Warm Regards,
Crystal
Microsoft Access MVP 2006
*
Have an awesome day ;)
remote programming and training
strive4peace2006 at yahoo.com
*
Kass wrote:
I need to be able to populate a list using choices from another list for a
science kit database I have.
I have one form called "Activities" with a subform call Kit Parts. I choose
from a list of Activities, and then populate the subform with all the Kit
Parts needed to perform that Activity. I have many Activities and their
corresponding Kit Parts housed in a Kit Detail Table. This all works just
fine!
Now what I need, is to be able to create a form and a corresponding report
where I can choose and add several different Activities into a subform that
together make a Kit. The form and its corresponding report will show a
comprehensive list of all the Kit Parts needed for all those Activities that
make up the Kit.
I know how to make a form where you choose from a list the Activity and it
shows the Kit Parts needed for that one Activity. But, I don't seem to be
able to take this to the "3D level" so to speak, where I choose MULTIPLE
Activities and the form (and eventually a report) will automatically show ALL
the Kit Parts needed for those chosen Activities.
Can anyone help me think through this barrier?
Thanks for your help!
Kass
- Follow-Ups:
- Re: Populating a list -- SQL basics
- From: strive4peace
- Re: Populating a list -- SQL basics
- References:
- Re: Populating a list
- From: strive4peace
- Re: Populating a list
- Prev by Date: Re: Parameter Query
- Next by Date: Navigation Bar Size
- Previous by thread: Re: Populating a list
- Next by thread: Re: Populating a list -- SQL basics
- Index(es):
Relevant Pages
|