beckie1234
Struggling Student
- Local time
- Yesterday, 20:35
- Joined
- Mar 10, 2007
- Messages
- 94
I am back. Sorry, but I still can't get this code to work for a cascading combo box. The tables are:
tblLine = lineID (pk), lineName
tblLineMach = lineID, machID (composite PK)
tblMachCent = machID (pk), machName
tblMachCat = machID, catID (compostite PK)
tblCategory = catID (pk), catName
The line feeds the machine center and the machine center feeds the category. The two tables tblLineMach and tblMachCat are bridge tables with composite PK tables to get rid of redundant data. When I had just tblLine, tblMachCent, tblCategory it worked great but I had redundant data, so I put in the bridge tables to get rid of the extra data and now it doesn't work. PLease help I am pulling my hair out.
Private Sub Line_AfterUpdate()
Me.MachineCenter.Enabled = True
Me.MachineCenter = Empty
Me.MachineCenter.RowSource = " SELECT tblLine.lineID, tblLineMach.lineID, tblLineMach.machID, tblMachCent.machID" & _
" FROM tblLine, tblLineMach, tblMachCent" & _
" WHERE tblLine.lineID = tblLineMach.lineID and tblLineMach.machID = tblMachCent.machID;"
End Sub
Private Sub MachineCenter_AfterUpdate()
Me.Category.Enabled = True
Me.Category = Empty
Me.Category.RowSource = " SELECT tblMachCent.machID, tblMachCat.machID, tblMachCat.catID, tblCategory.catID" & _
" FROM tblMachCent, tblMachCat, tblCategory" & _
" WHERE Between tblMachCent.machID = tblMachCat.machID AND tblMachCat.catID = tblCategory.catID;"
End Sub
Private Sub Category_AfterUpdate()
Me.Category.Requery
End Sub
tblLine = lineID (pk), lineName
tblLineMach = lineID, machID (composite PK)
tblMachCent = machID (pk), machName
tblMachCat = machID, catID (compostite PK)
tblCategory = catID (pk), catName
The line feeds the machine center and the machine center feeds the category. The two tables tblLineMach and tblMachCat are bridge tables with composite PK tables to get rid of redundant data. When I had just tblLine, tblMachCent, tblCategory it worked great but I had redundant data, so I put in the bridge tables to get rid of the extra data and now it doesn't work. PLease help I am pulling my hair out.
Private Sub Line_AfterUpdate()
Me.MachineCenter.Enabled = True
Me.MachineCenter = Empty
Me.MachineCenter.RowSource = " SELECT tblLine.lineID, tblLineMach.lineID, tblLineMach.machID, tblMachCent.machID" & _
" FROM tblLine, tblLineMach, tblMachCent" & _
" WHERE tblLine.lineID = tblLineMach.lineID and tblLineMach.machID = tblMachCent.machID;"
End Sub
Private Sub MachineCenter_AfterUpdate()
Me.Category.Enabled = True
Me.Category = Empty
Me.Category.RowSource = " SELECT tblMachCent.machID, tblMachCat.machID, tblMachCat.catID, tblCategory.catID" & _
" FROM tblMachCent, tblMachCat, tblCategory" & _
" WHERE Between tblMachCent.machID = tblMachCat.machID AND tblMachCat.catID = tblCategory.catID;"
End Sub
Private Sub Category_AfterUpdate()
Me.Category.Requery
End Sub