Here's what I have so far:
Private Sub cboSelectGroup_Change()
Dim groupSelection as Integer
Me("cboSelectCourse").Enabled = False
' cboSelectCourse, used in this With statement, is the first name of the
first combo box
With Me("cboSelectGroup")
.RowSource = "SELECT Groups.groupID, Groups.groupDescription,
Groups.courseCode " _
& "FROM Groups " _
& "WHERE (Groups.courseCode = ' & me!cboSelectCourse & ') " _
& "ORDER BY groupID"
.RowSourceType = "Table/Query"
.BoundColumn = 1
.ColumnCount = 3
.ColumnWidths = "0in;.05in;.05in"
.ListRows = 8
End With
groupSelection = me("cboSelectCourse")
End Sub
But the box still comes up blank.
"Gonty" <bl******@poczta.onet.pl> wrote in message
news:cd*********@news.onet.pl...
I want to have a second combo box have its selection options based on a
selection made in a first combo box. The first one gathers data from a
table, and the second one should gather data from a related table depending on the selections of the first. Using the wizard will give me a
specific field but will not have a WHERE clause. Is there some code to indicate
that the row source is built a variable in the sub set by the first combo
box?
Dim varValue
varValue=TextBox1.Value or varValue=TextBox1.Column(0)
TextBox2.RowSource="SELECT * FROM varTABLE WHERE v = " & varValue
--
Bye
Dariusz Myśliwiec
----------------------------------------------------------------------
E-mail: da***************@darekmysliwiec.biz
WWW: http://www.darekmysliwiec.biz/
-----------------------------------------------------------------------