G
Guest
I'm trying to fill a combo box list with a query in its Row Source. The
query is looking at some fields in a table but I'm mainly interested in Cycle
& Status. The status can be -1, 0, or 1. I want to fill the list with
cycles whose status is not -1, and I do not want duplicate cycles listed. I
put the following in the row source but it gives me duplicate cycles.
Me.cboCyclePM.RowSource = _
"SELECT tblPMHistory.Cycle, tblPMHistory.Dept,
tblPMHistory.CycleStatus " & _
"FROM tblPMHistory " & _
"GROUP BY tblPMHistory.Cycle, tblPMHistory.Dept,
tblPMHistory.CycleStatus " & _
"HAVING (((tblPMHistory.Dept) = [Forms]![frmEquipE]![cboDeptPM]) And
((tblPMHistory.CycleStatus) <> -1)) " & _
"ORDER BY tblPMHistory.Cycle;"
query is looking at some fields in a table but I'm mainly interested in Cycle
& Status. The status can be -1, 0, or 1. I want to fill the list with
cycles whose status is not -1, and I do not want duplicate cycles listed. I
put the following in the row source but it gives me duplicate cycles.
Me.cboCyclePM.RowSource = _
"SELECT tblPMHistory.Cycle, tblPMHistory.Dept,
tblPMHistory.CycleStatus " & _
"FROM tblPMHistory " & _
"GROUP BY tblPMHistory.Cycle, tblPMHistory.Dept,
tblPMHistory.CycleStatus " & _
"HAVING (((tblPMHistory.Dept) = [Forms]![frmEquipE]![cboDeptPM]) And
((tblPMHistory.CycleStatus) <> -1)) " & _
"ORDER BY tblPMHistory.Cycle;"