Tronsliver
Technical User
Jebry was so kind to help me with the following code I used for Rowsource in a listbox. However, I need to add another variable for seaching. The current variable it uses is "varx". I need to add an additional called "vary'. I was hoping someone could assist in properly formating the SQL string. The last line is where I need to insert "vary". So basically the function is to go to qryVacantSlots and find data based on "varx" and "vary"....thanks
sqlslots = "SELECT qryVacantSlots.Available As Open,"
sqlslots = sqlslots + " qryVacantSlots.strestrPosc As DutyPos, "
sqlslots = sqlslots + " qryVacantSlots.strestrGrade As Grade,"
sqlslots = sqlslots + " qryVacantSlots.strestrauthparadsg As Para,"
sqlslots = sqlslots + " qryVacantSlots.strestrauthlinedsg As Line,"
sqlslots = sqlslots + " qryVacantSlots.orgstruname As Unit,"
sqlslots = sqlslots + " qryVacantSlots.orgstraddresscity As City"
sqlslots = sqlslots + " FROM qryVacantSlots WHERE (((qryVacantSlots.orgstrPrNbr)"
sqlslots = sqlslots + " = '" & Format(varx) & "'));"
sqlslots = "SELECT qryVacantSlots.Available As Open,"
sqlslots = sqlslots + " qryVacantSlots.strestrPosc As DutyPos, "
sqlslots = sqlslots + " qryVacantSlots.strestrGrade As Grade,"
sqlslots = sqlslots + " qryVacantSlots.strestrauthparadsg As Para,"
sqlslots = sqlslots + " qryVacantSlots.strestrauthlinedsg As Line,"
sqlslots = sqlslots + " qryVacantSlots.orgstruname As Unit,"
sqlslots = sqlslots + " qryVacantSlots.orgstraddresscity As City"
sqlslots = sqlslots + " FROM qryVacantSlots WHERE (((qryVacantSlots.orgstrPrNbr)"
sqlslots = sqlslots + " = '" & Format(varx) & "'));"