cascading combo box code

shapman

Registered User.
Local time
Today, 06:18
Joined
Aug 30, 2007
Messages
55
hi,

I have three tables tblstatustype, tblpargroups, tblmedgroups.

I have set up the following code for a cascading combo box

Private Sub Statustype_AfterUpdate()

On Error Resume Next

Select Case cboStatus_type.Value

Case "Parliamentary"
cboSubstatus.RowSource = "tblpargroups"
Case "Media"
cboSubstatus.RowSource = "tblmedgroup"

End Select
End Sub


When the parliamentary or media options are chosen i need the substatus combo box to kick in with the relevant selections from the table.

Help. it doesnt seem to work, any ideas anyone???

thanks in advance,

help is much apreciated
 
You need a requery after setting the rowsource:

Code:
   cboSubstatus.Requery

You can put it between the End Select and End Sub lines so you only have it once, because it has to be done after either resetting of the rowsource.
 
You need a requery after setting the rowsource:

Code:
   cboSubstatus.Requery

You can put it between the End Select and End Sub lines so you only have it once, because it has to be done after either resetting of the rowsource.

This doesn't seem to work either, the code now looks like

Private Sub Statustype_AfterUpdate()

On Error Resume Next

Select Case cboStatustype.Value

Case "Parliamentary"
cboSubstatus.RowSource = "tblpargroups"
Case "Media"
cboSubstatus.RowSource = "tblmedgroup"

End Select

cboSubstatus.Requery

End Sub


I have also tried putting cbostatustype.Requery but this doesnt seem to work either. Have you any more ideas?
thnaks in advance
 

Users who are viewing this thread

Back
Top Bottom