I am trying to get two comboboxes working that are dependant on each other, on eis called cboSelTitle and the second cboSelSys.
Rowsource for cboSelTitle:
SELECT DISTINCT PMI.number, PMI.Title FROM PMI ORDER BY PMI.number
Private SUB cboSelTitle_AfterUpdate()
Me. Title.SetFocus
DoCmd.FIndRecord Me.cboSelTitle
End Sub
Rowsource for cbo SelSys:
SELECT DISTINCT PMI.system FROM PMI WHERE (((PMI.title) LIKE [Forms]![PMI_Signoff_Test1]![cboSelTitle]));
Private Sub cbo SelSys_AfterUpdate()
Dim strSearch As String
strSearch = "Title = " & CHR$(34) & Me![cboTitle] & Chr$(34)
Me.RecordSetClone.FindFirst strSearch
Me.Bookmark = Me.RecordsetClone.Bookmark
Me.System.SetFocus
DoCmd.FindRecord Me.cboSelTitle
End Sub
I am using the following in the On Enter event in both comboboxes:
=ctlRequery()
Which calls the below function:
Public Function ctlRequery()
On Error GoTo Err_ctlRequery
Dim ctl As Control
Set ctl = Screen.ActiveControl
ctl.Requery
Exit Function
Err_ctlRequery:
Exit Function
End Function
WHat is happening is that when I choose the Title combo it comes upi fine and shows records for that Title. Then when I go to second combo "cboSelSys" it shows the selections (in the combobox) for what was chosen in the title, but when selected it doesn't show results? I know I'm missing something silly here. Could someone steer me right?
Jim
Rowsource for cboSelTitle:
SELECT DISTINCT PMI.number, PMI.Title FROM PMI ORDER BY PMI.number
Private SUB cboSelTitle_AfterUpdate()
Me. Title.SetFocus
DoCmd.FIndRecord Me.cboSelTitle
End Sub
Rowsource for cbo SelSys:
SELECT DISTINCT PMI.system FROM PMI WHERE (((PMI.title) LIKE [Forms]![PMI_Signoff_Test1]![cboSelTitle]));
Private Sub cbo SelSys_AfterUpdate()
Dim strSearch As String
strSearch = "Title = " & CHR$(34) & Me![cboTitle] & Chr$(34)
Me.RecordSetClone.FindFirst strSearch
Me.Bookmark = Me.RecordsetClone.Bookmark
Me.System.SetFocus
DoCmd.FindRecord Me.cboSelTitle
End Sub
I am using the following in the On Enter event in both comboboxes:
=ctlRequery()
Which calls the below function:
Public Function ctlRequery()
On Error GoTo Err_ctlRequery
Dim ctl As Control
Set ctl = Screen.ActiveControl
ctl.Requery
Exit Function
Err_ctlRequery:
Exit Function
End Function
WHat is happening is that when I choose the Title combo it comes upi fine and shows records for that Title. Then when I go to second combo "cboSelSys" it shows the selections (in the combobox) for what was chosen in the title, but when selected it doesn't show results? I know I'm missing something silly here. Could someone steer me right?
Jim