C
Christine
A have two combo boxes on a form that the user can use to
select search criteria for a subform based on (mutually-
exclusive) option buttons.
Each time the user moves between the two boxes, I'd like
their previous selection in the combo to disappear. I
have tried a suggestion by ??? that I found in the posts,
but it doesn't work for me:
'A1 - assign a value that is listed in the bound column of
'> the combobox. For example bound Column(0) employeeID =
'> 1023 and visible Column(1) Employee = "Eric Idle"
'>
'> cboEmployeeID.value=1023 will select Eric Idle
'>
'> A2 - with cboEmployeeID
'> .value=.itemdata(-1)
'> End With
Here is the above code (in Select Case 2) in my
application:
Private Sub FrameSearchChoice_AfterUpdate()
' Set main form controls & link criteria for the subform
Select Case Me.FrameSearchChoice
Case 1 'Search by CARNum
Me.CARNum.Enabled = True
Me.AssignToID.Enabled = False
Me.subfrm_Respond_Dialog.LinkMasterFields = "CARNum"
Me.subfrm_Respond_Dialog.LinkChildFields = "CARNum"
Case 2 'Search by AssignToID
Me.AssignToID.Enabled = True
AssignToID.Value = 1
With AssignToID
.Value = .ItemData(-1)
End With
Me.CARNum.Enabled = False
Me.subfrm_Respond_Dialog.LinkMasterFields =
"AssignToID"
Me.subfrm_Respond_Dialog. _
LinkChildFields = "AssignToID"
End Select
End Sub
The With...Endwith doesn't do anything. I have tried it
in various places/events with no success. If it matters,
the combo boxes are unbound.
Any help with ???'s code or another suggestion to clear
combo boxes will be apppreciated!
As always, thanks to all,
Christine
select search criteria for a subform based on (mutually-
exclusive) option buttons.
Each time the user moves between the two boxes, I'd like
their previous selection in the combo to disappear. I
have tried a suggestion by ??? that I found in the posts,
but it doesn't work for me:
'A1 - assign a value that is listed in the bound column of
'> the combobox. For example bound Column(0) employeeID =
'> 1023 and visible Column(1) Employee = "Eric Idle"
'>
'> cboEmployeeID.value=1023 will select Eric Idle
'>
'> A2 - with cboEmployeeID
'> .value=.itemdata(-1)
'> End With
Here is the above code (in Select Case 2) in my
application:
Private Sub FrameSearchChoice_AfterUpdate()
' Set main form controls & link criteria for the subform
Select Case Me.FrameSearchChoice
Case 1 'Search by CARNum
Me.CARNum.Enabled = True
Me.AssignToID.Enabled = False
Me.subfrm_Respond_Dialog.LinkMasterFields = "CARNum"
Me.subfrm_Respond_Dialog.LinkChildFields = "CARNum"
Case 2 'Search by AssignToID
Me.AssignToID.Enabled = True
AssignToID.Value = 1
With AssignToID
.Value = .ItemData(-1)
End With
Me.CARNum.Enabled = False
Me.subfrm_Respond_Dialog.LinkMasterFields =
"AssignToID"
Me.subfrm_Respond_Dialog. _
LinkChildFields = "AssignToID"
End Select
End Sub
The With...Endwith doesn't do anything. I have tried it
in various places/events with no success. If it matters,
the combo boxes are unbound.
Any help with ???'s code or another suggestion to clear
combo boxes will be apppreciated!
As always, thanks to all,
Christine