Mutiple Syntax in one sub

Petros

Registered User.
Local time
Today, 05:53
Joined
Jun 30, 2010
Messages
145
Hi all, trying to make my self understood i wonder if it is possible to
include "multiple" syntax in one sub..the same sub would also have to include more code..IF statements etc

Private Sub cmbo1_AfterUpdate()

Me!cmbo2.RowSource = "Select tbl1.text2 " & _
"FROM tbl1 " & _
"WHERE tbl1.text1 = '" & cmbo1.text1 & "' " & _
"ORDER BY tbl1.text2;"

----

Me!cmbo3.RowSource = "Select tbl2.text2 " & _
"FROM tbl2 " & _
"WHERE tbl2.text1 = '" & cmbo1.text1 & "' " & _
"ORDER BY tbl2.text2;"


End sub

Thanks!
 
You should have no trouble setting the RowSource of any number of ComboBoxes in the AfterUpdate event of a cbo; not with the syntax you have there of course.
 
If you underlying purpose is to have a series of related combo boxes, you may want to search for Cascading Combo boxes.

There are some excellent video tutorials at Datapig --
here's one for 2 related combos
http://www.datapigtechnologies.com/flashfiles/combobox2.html
 

Users who are viewing this thread

Back
Top Bottom