Adding and Selecting "All" to Combo Box???


T

TotallyConfused

I have a combo box with a source type of Value list and month and year listed
for two years. You can only choose 1 item to select. Is there any way to
be able to choose multiple items at one time?? Also to add "All" to the list
to be able to choose all the items if needed? Thank you very much for any
help you can provide.
 
Ad

Advertisements

Joined
Dec 17, 2007
Messages
57
Reaction score
0
TotallyConfused said:
I have a combo box with a source type of Value list and month and year listed
for two years. You can only choose 1 item to select. Is there any way to
be able to choose multiple items at one time?? Also to add "All" to the list
to be able to choose all the items if needed? Thank you very much for any
help you can provide.

You can add All to the value list

In the value list All;NextValue;NextValue.....
I don't believe you can select multiple in Combobox

Listbox allows multiselect
 
M

Mike Painter

TotallyConfused said:
I have a combo box with a source type of Value list and month and
year listed for two years. You can only choose 1 item to select.
Is there any way to be able to choose multiple items at one time??
Also to add "All" to the list to be able to choose all the items if
needed? Thank you very much for any help you can provide.

Not in a combo box but you can in a list box.

If the list is not huge and the selections are likely to remain the same for
a time there is another approach.
Add a "yes/no" called "Selected" checkbox to your table.
Create a subform set to dataview and add the fields you need.
Add a button for "select all" and "clear all" that sets the boolian field to
True or False.
The report, etc, is based on Selected = True.

My first app using this allowed a lab tech to run reports based on one or
more doctors running a set of tests.
 
T

Tommo

I want to do the same thing as TotallyConfused so this thread is really
helpful.
I have tried putting the "Select All" button in the Detail Section, the Page
Header Section and the Form Header Section but it never appears when I run
the form.
What am I doing wrong?
 
T

TotallyConfused

Thank you very much for your response and suggestions. I have a form where I
select the items from a combo box. The list consists of Month and Year one
column. Once I select an item, I click on command button and report opens
with the cases for the month selected.

My combo box is like the last example in the www.mvps.org/access/forms page.
I took the code shown on this page

Private Sub Form_Open(Cancel As Integer)
With Me.Combo0
.RowSourceType = "Value List"
.RowSource = "(ALL);" & .RowSource
End With
End Sub

I put this is the open Even on the form. But this did not work. Can you
help me revise this? Thank you.
 
Joined
Dec 17, 2007
Messages
57
Reaction score
0
TotallyConfused said:
Thank you very much for your response and suggestions. I have a form where I
select the items from a combo box. The list consists of Month and Year one
column. Once I select an item, I click on command button and report opens
with the cases for the month selected.

My combo box is like the last example in the www.mvps.org/access/forms page.
I took the code shown on this page

Private Sub Form_Open(Cancel As Integer)
With Me.Combo0
.RowSourceType = "Value List"
.RowSource = "(ALL);" & .RowSource
End With
End Sub

I put this is the open Even on the form. But this did not work. Can you
help me revise this? Thank you.

>

I just created a combo on a form and used this code on Form_Open
Code:
Private Sub Form_Open(Cancel As Integer)
 Me.Combo2.RowSource = "(All);" & Me.Combo2.RowSource
 End Sub

I also created the Value list.
see attached images
 

Attachments

  • pcreview.jpg
    pcreview.jpg
    8.6 KB · Views: 177
  • pcreview0.jpg
    pcreview0.jpg
    22.1 KB · Views: 157
Ad

Advertisements

M

Mike Painter

Tommo said:
I want to do the same thing as TotallyConfused so this thread is
really helpful.
I have tried putting the "Select All" button in the Detail Section,
the Page Header Section and the Form Header Section but it never
appears when I run the form.
What am I doing wrong?

If the button does not appear I can only assume you have set it's visible
property to False or made it real small.
 

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