C
chris.edwards20
I have a form with a tabbed area in the lower part to accommodate
different categories of data. One tab has two combos cboJobGroup and
cboJobSubgroup. The rowsource property in cboJobSubgroup includes
reference to the value of cboJobGroup so that only appropriate values
for the Job Group are offered.
I am using the following code to ensure that only valid combinations
are chosen
Private Sub cboJobGroup_Dirty(Cancel As Integer)
'clear Job subgroup if job group is changed
Me!cboJobSubgroup.Value = Null
End Sub
Private Sub cboJobGroup_AfterUpdate()
'requeries subgroup combo to update the rowsource property with
the value entered for the JobGroup in this combo
Me!cboJobSubgroup.Requery
End Sub
But it doesn't work (although I think it did when I originally set it
up). To double check that I hadn't made some error in the code I added
a temporary command button on the tab which does the same things as
the above
Private Sub Command137_Click()
Me!cboJobSubgroup.Value = Null
Me!cboJobSubgroup.Requery
End Sub
Clicking it does have the expected effects. It would appear that the
AfterUpdate and the Dirty events are not occuring as expected as the
code attached to these does not appear to be run. I can't see why this
is - has anyone got any light to throw on the problem?
Chris
different categories of data. One tab has two combos cboJobGroup and
cboJobSubgroup. The rowsource property in cboJobSubgroup includes
reference to the value of cboJobGroup so that only appropriate values
for the Job Group are offered.
I am using the following code to ensure that only valid combinations
are chosen
Private Sub cboJobGroup_Dirty(Cancel As Integer)
'clear Job subgroup if job group is changed
Me!cboJobSubgroup.Value = Null
End Sub
Private Sub cboJobGroup_AfterUpdate()
'requeries subgroup combo to update the rowsource property with
the value entered for the JobGroup in this combo
Me!cboJobSubgroup.Requery
End Sub
But it doesn't work (although I think it did when I originally set it
up). To double check that I hadn't made some error in the code I added
a temporary command button on the tab which does the same things as
the above
Private Sub Command137_Click()
Me!cboJobSubgroup.Value = Null
Me!cboJobSubgroup.Requery
End Sub
Clicking it does have the expected effects. It would appear that the
AfterUpdate and the Dirty events are not occuring as expected as the
code attached to these does not appear to be run. I can't see why this
is - has anyone got any light to throw on the problem?
Chris