unbound list box

M

Miskacee

How do I reference a selection in an unbound list box to another form?
I had [forms]![frm_list]![lstRegion] - this is the list box name on the one
form but inside the lstRegion there are 2 regions and I would like to
reference both on another form.

Thank you !
 
J

Jeff Boyce

Are you saying that there are multiple selections made in that "other form's
listbox"? I don't believe I've seen that approach before, but maybe one of
the other newsgroup readers has worked on something like this.

If this were mine, I'd be looking into how to iterate through the collection
of selected items ...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

Miskacee

I have a form with unbound list boxes, user select a list from an unbound
box, called Region and there are several regions listed. I also have
several other unbound boxes, location, city - within location are several
locations. The user can select 1 or many from each unbound list box. From
this selection, they select apply filter and then goes to a form, listing
what they have selected. This is then validated - yes this is the info -
then a button is selected and then a graph is presented showing employment
reasons - based upon the filters selected. At the top of that report, I want
to list what was selected originally in the filter.

Hope this makes sense!


Jeff Boyce said:
Are you saying that there are multiple selections made in that "other form's
listbox"? I don't believe I've seen that approach before, but maybe one of
the other newsgroup readers has worked on something like this.

If this were mine, I'd be looking into how to iterate through the collection
of selected items ...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Miskacee said:
How do I reference a selection in an unbound list box to another form?
I had [forms]![frm_list]![lstRegion] - this is the list box name on the
one
form but inside the lstRegion there are 2 regions and I would like to
reference both on another form.

Thank you !
 
J

Jeff Boyce

Again, check into how you'd iterate through a collection of the control's
selected items. It requires a bit of coding...

Regards

Jeff Boyce
Microsoft Office/Access MVP


Miskacee said:
I have a form with unbound list boxes, user select a list from an unbound
box, called Region and there are several regions listed. I also have
several other unbound boxes, location, city - within location are several
locations. The user can select 1 or many from each unbound list box.
From
this selection, they select apply filter and then goes to a form, listing
what they have selected. This is then validated - yes this is the info -
then a button is selected and then a graph is presented showing employment
reasons - based upon the filters selected. At the top of that report, I
want
to list what was selected originally in the filter.

Hope this makes sense!


Jeff Boyce said:
Are you saying that there are multiple selections made in that "other
form's
listbox"? I don't believe I've seen that approach before, but maybe one
of
the other newsgroup readers has worked on something like this.

If this were mine, I'd be looking into how to iterate through the
collection
of selected items ...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Miskacee said:
How do I reference a selection in an unbound list box to another form?
I had [forms]![frm_list]![lstRegion] - this is the list box name on the
one
form but inside the lstRegion there are 2 regions and I would like to
reference both on another form.

Thank you !
 
M

Miskacee

That is my issue, I don't know how to do this. I tried referencing those
'regions' selected and want to take the selected regions and show this in
another report - referencing Ap, ESa regions are what was selected based upon
the graph that is created. ANy suggestions?

Thanks!


Jeff Boyce said:
Again, check into how you'd iterate through a collection of the control's
selected items. It requires a bit of coding...

Regards

Jeff Boyce
Microsoft Office/Access MVP


Miskacee said:
I have a form with unbound list boxes, user select a list from an unbound
box, called Region and there are several regions listed. I also have
several other unbound boxes, location, city - within location are several
locations. The user can select 1 or many from each unbound list box.
From
this selection, they select apply filter and then goes to a form, listing
what they have selected. This is then validated - yes this is the info -
then a button is selected and then a graph is presented showing employment
reasons - based upon the filters selected. At the top of that report, I
want
to list what was selected originally in the filter.

Hope this makes sense!


Jeff Boyce said:
Are you saying that there are multiple selections made in that "other
form's
listbox"? I don't believe I've seen that approach before, but maybe one
of
the other newsgroup readers has worked on something like this.

If this were mine, I'd be looking into how to iterate through the
collection
of selected items ...

Regards

Jeff Boyce
Microsoft Office/Access MVP

How do I reference a selection in an unbound list box to another form?
I had [forms]![frm_list]![lstRegion] - this is the list box name on the
one
form but inside the lstRegion there are 2 regions and I would like to
reference both on another form.

Thank you !
 
G

George Hepworth

Here's an example of a function that walks the selected items in a list box
and "does something" with them.

You'll need to supply the "Do Something" from your existing code, of course


Private Sub cmdDoSomethingWithMultiSelectListBox_Click()
On Error GoTo ErrHandler
Dim varItm As Variant


For Each varItm In Me.lstSelected.ItemsSelected

' "Add your code to 'Do Something' with the selected item."

Next varItm

exitProc:
Exit Sub
ErrHandler:
fGlobalErrorMessage (err, erl, Screen.ActiveForm.Caption)
Resume exitProc
End Sub


Miskacee said:
That is my issue, I don't know how to do this. I tried referencing those
'regions' selected and want to take the selected regions and show this in
another report - referencing Ap, ESa regions are what was selected based
upon
the graph that is created. ANy suggestions?

Thanks!


Jeff Boyce said:
Again, check into how you'd iterate through a collection of the control's
selected items. It requires a bit of coding...

Regards

Jeff Boyce
Microsoft Office/Access MVP


Miskacee said:
I have a form with unbound list boxes, user select a list from an
unbound
box, called Region and there are several regions listed. I also have
several other unbound boxes, location, city - within location are
several
locations. The user can select 1 or many from each unbound list box.
From
this selection, they select apply filter and then goes to a form,
listing
what they have selected. This is then validated - yes this is the
info -
then a button is selected and then a graph is presented showing
employment
reasons - based upon the filters selected. At the top of that report,
I
want
to list what was selected originally in the filter.

Hope this makes sense!


:

Are you saying that there are multiple selections made in that "other
form's
listbox"? I don't believe I've seen that approach before, but maybe
one
of
the other newsgroup readers has worked on something like this.

If this were mine, I'd be looking into how to iterate through the
collection
of selected items ...

Regards

Jeff Boyce
Microsoft Office/Access MVP

How do I reference a selection in an unbound list box to another
form?
I had [forms]![frm_list]![lstRegion] - this is the list box name on
the
one
form but inside the lstRegion there are 2 regions and I would like
to
reference both on another form.

Thank you !
 
M

Miskacee

I have this information within the verbiage and it works going to another
form. Now I need to reference a report.

This is my code:
For Each varItem In Me.lstpositionType.ItemsSelected
strPositionType = strPositionType & ",'" &
Me.lstpositionType.ItemData(varItem) _
& "'"
'--------------
'WHAT DO I PLACE HERE SINCE THIS DOESN'T WORK
strPositionType = Reports!pie_graph!positionType
'--------------
Next varItem

I don't know how to reference a txt box in the report. I named the text box
positiontype instead of txtpositiontype.

QUESTION: How do I reference the report heading in the report? If I can get
this corrected, then I'm finally finished!

Thank you for your help!

George Hepworth said:
Here's an example of a function that walks the selected items in a list box
and "does something" with them.

You'll need to supply the "Do Something" from your existing code, of course


Private Sub cmdDoSomethingWithMultiSelectListBox_Click()
On Error GoTo ErrHandler
Dim varItm As Variant


For Each varItm In Me.lstSelected.ItemsSelected

' "Add your code to 'Do Something' with the selected item."

Next varItm

exitProc:
Exit Sub
ErrHandler:
fGlobalErrorMessage (err, erl, Screen.ActiveForm.Caption)
Resume exitProc
End Sub


Miskacee said:
That is my issue, I don't know how to do this. I tried referencing those
'regions' selected and want to take the selected regions and show this in
another report - referencing Ap, ESa regions are what was selected based
upon
the graph that is created. ANy suggestions?

Thanks!


Jeff Boyce said:
Again, check into how you'd iterate through a collection of the control's
selected items. It requires a bit of coding...

Regards

Jeff Boyce
Microsoft Office/Access MVP


I have a form with unbound list boxes, user select a list from an
unbound
box, called Region and there are several regions listed. I also have
several other unbound boxes, location, city - within location are
several
locations. The user can select 1 or many from each unbound list box.
From
this selection, they select apply filter and then goes to a form,
listing
what they have selected. This is then validated - yes this is the
info -
then a button is selected and then a graph is presented showing
employment
reasons - based upon the filters selected. At the top of that report,
I
want
to list what was selected originally in the filter.

Hope this makes sense!


:

Are you saying that there are multiple selections made in that "other
form's
listbox"? I don't believe I've seen that approach before, but maybe
one
of
the other newsgroup readers has worked on something like this.

If this were mine, I'd be looking into how to iterate through the
collection
of selected items ...

Regards

Jeff Boyce
Microsoft Office/Access MVP

How do I reference a selection in an unbound list box to another
form?
I had [forms]![frm_list]![lstRegion] - this is the list box name on
the
one
form but inside the lstRegion there are 2 regions and I would like
to
reference both on another form.

Thank you !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top