Combo Box help

  • Thread starter Thread starter BK
  • Start date Start date
B

BK

Hello,
I have 2 tables tbl.shape [shape.shape_id, shape.name]
and tbl.size, [shape_id, size.name]

I'm trying to builld combo boxes SHAPE and SIZE

cbo.SHAPE has a section of 6 possible shapes. when one is selected I want it
to populate the second cbo.size with the appropraite sizes from tbl.size.

I have tried multiple methods and not having success on something that would
appear to be so easy.

Private sub SIZE_AfterUpdate()
Dim strSQL as String

If Len(Me.SIZE) > 0 Then
Me.SIZE = Null

strSQL = "SELECT DISTINCT SHAPE_ID" _
& "FROM tblSIZE "_
& "WHERE SHAPE_ID = "" & me.chooseSIZE & """

Debug.Print strSQL
me.SIZE.RowSource = strSQL

End Sub

Maybe I'm going down the wrong path???


Any help would be greatly appricaited!
 
What you are trying to do is known as Cascading Combo boxes. If you google
you will find lots of examples and explanations. That said, here are a few I
refer to people:

http://www.fontstuff.com/access/acctut10.htm
http://www.rogersaccesslibrary.com/...?TID=389&KW=cascading+combo+boxes&PID=389#389
http://bytes.com/topic/access/insights/605958-cascading-combo-list-boxes

--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
Back
Top