sqlstring3 = "SELECT DISTINCT name1 FROM clientstats WHERE Trainer="+""+PopupMenu1.text+""+"order name1 by asec"
rs= db.sqlSelect (sqlstring3)
numberofrecords = rs.recordCount
for row =1 to numberofrecords
s= rs.field("name1").stringValue
rs.movenext
popupmenu2.addrow (s)
next
There is only one PopupMenu in your example code, so I’m not sure what you mean. If the rs is Nil after the SQLSelect, then you have a DB error, you should check DBError and DBErrorMessage.