The code for cascading combo boxes would go like this:
On the On Open event of the form, and on the Print button, add this code:
[Forms]![frmYourForm].[SerialNoList].RowSource = ""
For the City list box, I think you can use the same data source you have now:
"SELECT DISTINCT [City] FROM tblYourCityTable"
Then on the On Click event of your City list box, add this code:
Dim sSQL As String
Dim sString As String
If IsNull(Me.CityList.Value) Or Me.CityList.Value = "" Then
[Forms]![frmYourForm].[SerialNoList].RowSource = ""
Exit Sub
Else
sString = Me.CityList.Value
End If
sSQL = "SELECT DISTINCT [Serial No] FROM tblYourTable WHERE [City] = '" & sString & "' AND [Print] = 0"
[Forms]![frmYourForm].[SerialNoList].RowSource = sSQL
This will populate the Serial No List with only those serial numbers associated with that city, and that have not been printed.
Did that help?
mmcdonal
Look it up at:
http://wrox.books24x7.com