Listbox query

smallWorld

Registered User.
Local time
Tomorrow, 05:12
Joined
Jan 10, 2008
Messages
15
Hi all,

I've two listboxes.

The first listbox contains Roses, lilies, Cactus, etc. When the user select Roses, the second listbox will display Pink roses, red roses, white roses, etc, and not all the other flowers that's in the table.

What should I do? I'm using Access 2003. Thanks in advance!
 
search for cascading combo boxes there are a few examples of this already on this site.
 
Problems with combo box

Hi,

I was following Example 2 in http://www.fontstuff.com/access/acctut10.htm.

I have 2 combo boxes, namely cboCountry and cboCity. I have a table (tblAll) with 2 fields, Country and City.

For cboCountry, the Row Source property is SELECT DISTINCT tblAll.Country FROM tblAll ORDER BY tblAll.Country;


For cboCountry, the AfterUpdate() event is

Private Sub cboCountry_AfterUpdate()
On Error Resume Next
cboCity.RowSource = "Select tblAll.City " & _
"FROM tblAll " & _
"WHERE tblAll.Country = '" & cboCountry.Value & "'" & _
"ORDER BY tblAll.City;"

End Sub

Problem:
I have a button that should store the value of both combo box to another table (UChose) with two fields (UCountry and UCity). How should I code this button?

Thank you so much!
 
Last edited:

Users who are viewing this thread

Back
Top Bottom