>1- for example I have 5-6 criteria on the form and all of criteria comes with combobox and combobox contains related records their dbf's (combo1=scholltype,combo2=city,combo3=sex etc...) when I want to select from combo1 for 'highscholl',from combo2 'texas', for combo3 ALL (both of two sexuality) how should I write the SQL syntax ( e.g "select * from mydata where mydata.scholltype=thisform.combo1.value;
>and mydata.city=thisform.combo2.value;
>and mydata.sex=thisform.combo3.value; && how ??? (value must be male+female)
>into cursor myresult nofilter
Create variables to store the combo values. Build your SQL string then execute it:
lcScholl = ThisForm.Combo1.DisplayValue [or .Value]
lcCity = ThisForm.Combo2.DisplayValue
lcSex = ThisForm.Combo3.DisplayValue
lcString = "mydata.scholltype = '" + lcScholl + "' and "
lcString = lcString + "mydata.city = '" + lcCity + "'"
if lcSex <> 'ALL'
lcString = lcString + " and mydata.sex = '" + lcSex + "'"
endif
select * from mydata where &lcString
Mark McCasland
Midlothian, TX USA