djenkins728
Programmer
Okay I'm new and frustrated and tired, so please I hope you can help. I already viewed Utterangel's db on cascading combo boxes and it helped a lot. What I don't understand is --on my form after the user selects the cbo_calledby, cbo_ship, and cbo_dept how can I get the cbo_hull to work (which is named call-intype). I've included the code I have so far. Again thanks and any help is appreciated.
Private Sub cbo_Calledby_AfterUpdate()
With Me![cbo_deptselect]
If IsNull(Me!cbo_Calledby) Then
.RowSource = " "
Else
.RowSource = "Select DISTINCT [dept] " & _
"From tbl_MainInfo " & _
"Where [calledby_id]=" & Me!cbo_Calledby
End If
Call .Requery
End With
End Sub
Private Sub cbo_deptselect_AfterUpdate()
With Me![cbo_shipselect]
If IsNull(Me!cbo_deptselect) Then
.RowSource = " "
Else
.RowSource = "Select DISTINCT [ship] " & _
"From tbl_MainInfo " & _
"Where [dept] like '*" & Me!cbo_deptselect & "*'"
End If
Call .Requery
End With
End Sub
Private Sub cbo_Hull_AfterUpdate()
With Me![cbo_Calledby, cbo_deptselect, cbo_shipselect]
If IsNull(Me!cbo_shipselect) Then
.RowSource = " "
Else
.RowSource = "Select DISTINCT [Call-InType] " & _
"From tbl_MainInfo " & _
"Where [ship]=" & Me!cbo_shipselect
End If
Call .Requery
End With
End Sub
Private Sub cbo_shipselect_AfterUpdate()
With Me![cbo_Hull]
If IsNull(Me!cbo_shipselect) Then
.RowSource = " "
Else
.RowSource = "Select DISTINCT [Call-InType] " & _
"From tbl_MainInfo " & _
"Where [ship]=" & Me!cbo_shipselect
End If
Call .Requery
End With
End Sub
Private Sub cbo_Calledby_AfterUpdate()
With Me![cbo_deptselect]
If IsNull(Me!cbo_Calledby) Then
.RowSource = " "
Else
.RowSource = "Select DISTINCT [dept] " & _
"From tbl_MainInfo " & _
"Where [calledby_id]=" & Me!cbo_Calledby
End If
Call .Requery
End With
End Sub
Private Sub cbo_deptselect_AfterUpdate()
With Me![cbo_shipselect]
If IsNull(Me!cbo_deptselect) Then
.RowSource = " "
Else
.RowSource = "Select DISTINCT [ship] " & _
"From tbl_MainInfo " & _
"Where [dept] like '*" & Me!cbo_deptselect & "*'"
End If
Call .Requery
End With
End Sub
Private Sub cbo_Hull_AfterUpdate()
With Me![cbo_Calledby, cbo_deptselect, cbo_shipselect]
If IsNull(Me!cbo_shipselect) Then
.RowSource = " "
Else
.RowSource = "Select DISTINCT [Call-InType] " & _
"From tbl_MainInfo " & _
"Where [ship]=" & Me!cbo_shipselect
End If
Call .Requery
End With
End Sub
Private Sub cbo_shipselect_AfterUpdate()
With Me![cbo_Hull]
If IsNull(Me!cbo_shipselect) Then
.RowSource = " "
Else
.RowSource = "Select DISTINCT [Call-InType] " & _
"From tbl_MainInfo " & _
"Where [ship]=" & Me!cbo_shipselect
End If
Call .Requery
End With
End Sub