How do you select multiple choices in access database dropbox?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am building a data base for a reality company and they need to select
multiple appliances that are included with the sale, how do I create such a
list in access?
 
I am building a data base for a reality company and they need to select
multiple appliances that are included with the sale, how do I create such a
list in access?

In a drop box? I assume you mean a Combo Box.
You can't.

Use a List box on a form .
Set it's MultiSelect property to Extended.
You'll also need code in the List Box Exit event to return all the
selected values.

Private Sub lstAppliances_Exit(Cancel As Integer)

Dim strString As String
Dim varItem As Variant
For Each varItem In lstAFriend.ItemsSelected
strString = strString & lstAFriend.ItemData(varItem) & ", "
Next varItem

[SomeControlOnForm] = strString

End Sub

Freezer; Stove; Dish Washer;
 
I think FUNPIX needs to create a junction table of Sales and appliances. At
this time (through version 2003) this is best implemented using a subform on
the "Sale" form.

The junction table would include the primary keys from the Sale table and
the Appliance table.

--
Duane Hookom
MS Access MVP


fredg said:
I am building a data base for a reality company and they need to select
multiple appliances that are included with the sale, how do I create such
a
list in access?

In a drop box? I assume you mean a Combo Box.
You can't.

Use a List box on a form .
Set it's MultiSelect property to Extended.
You'll also need code in the List Box Exit event to return all the
selected values.

Private Sub lstAppliances_Exit(Cancel As Integer)

Dim strString As String
Dim varItem As Variant
For Each varItem In lstAFriend.ItemsSelected
strString = strString & lstAFriend.ItemData(varItem) & ", "
Next varItem

[SomeControlOnForm] = strString

End Sub

Freezer; Stove; Dish Washer;
 
I appreciate your help but I failed to mentioned that I have never wrote a
data base ever, so the additional coding is very confusing to me. Can you
suggest any good books or sites that may aid in my understanding? Thanks

Duane Hookom said:
I think FUNPIX needs to create a junction table of Sales and appliances. At
this time (through version 2003) this is best implemented using a subform on
the "Sale" form.

The junction table would include the primary keys from the Sale table and
the Appliance table.

--
Duane Hookom
MS Access MVP


fredg said:
I am building a data base for a reality company and they need to select
multiple appliances that are included with the sale, how do I create such
a
list in access?

In a drop box? I assume you mean a Combo Box.
You can't.

Use a List box on a form .
Set it's MultiSelect property to Extended.
You'll also need code in the List Box Exit event to return all the
selected values.

Private Sub lstAppliances_Exit(Cancel As Integer)

Dim strString As String
Dim varItem As Variant
For Each varItem In lstAFriend.ItemsSelected
strString = strString & lstAFriend.ItemData(varItem) & ", "
Next varItem

[SomeControlOnForm] = strString

End Sub

Freezer; Stove; Dish Washer;
 
FUNPIX said:
I appreciate your help but I failed to mentioned that I have never wrote a
data base ever, so the additional coding is very confusing to me. Can you
suggest any good books or sites that may aid in my understanding? Thanks

FUNPIX,

Websites:

http://www.mvps.org/access
http://allenbrowne.com/
http://home.bendbroadband.com/conradsystems/accessjunkie/resources.html#Articles


Books: General: Beginner

Database Design for Mere Mortals by Michael J. Hernandez

SQL Queries for Mere Mortals by Michael J. Hernandez, John L. Viescas


Books: Access : Intermediate

Access Cookbook by Getz, Litwin, and Baron
(Compilation of solutions, listed by task-category)


Books: Access: Advanced

Access Database Design & Programming by Steven Roman (2nd Edition)

Access Developer's Handbook (for your version of Access)


Sincerely,

Chris O.
 
Back
Top