Multi selection

W

Willowdillo

I have a list that contains many options from which a salesperson can select
one or more. Multiselect is set to Simple. The problem I have is: If the
first item on the list (Customer declines all options) is selected, any
additional items selected will also be added to the option table.
First, I would like a message to appear telling salesperson something to the
effect of "You have selected the 'declined option' and that is the only
option that will appear on your quote."

Secondly I want to close the option form and

Thirdly I would also like to have only that first item appear in my table.

I have tried working with an If loop and have had it just all the way in,
around and through, the working For...Next loop I have. As you can probably
tell, I am a VB novice and am tearing my hair out here! Seemed like such a
simple thing...

Here is working code I have so far to get all chosen options to table:

Private Sub UpdateCmdBtn_Click()
Dim txtwoodspecnum As Integer
Dim ctl As Control, varItem As Variant

Set ctl = Me.strucspecslst

For Each varItem In ctl.ItemsSelected
DoCmd.GoToRecord , , acNewRec
Me.TxtCust = ComboCust
Me.TxtStrucSpecs = ctl.Column(0, varItem)
Me.txtwoodspecnum = ctl.Column(1, varItem)
Next varItem

Set ctl = Nothing

End Sub
I am hoping someone would kindly enlighten me.
 
D

DomThePom

Add a check box to your form for "declines all options"

when checked, disable clear and disable you options list box
 

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