Z
zombeerose
I have created 2 forms - 1) Master form for selecting a
person and 2) Sub form for entering 1+ time logs for the
selected individual. On the Sub form, the detail section
can display multiple records. Per each detail record, a
job can be assigned as well as a corresponding job step.
Both the job and job step can be selected from drop-down
combo boxes.
I have written code to update the rowsource for my job
step combo box when the job combo is changed. The problem
is that when a user selects a different job from the combo
box, the row source for EVERY job step combo box is
changed rather than the corresponding detail record.
Code for updating rowsource:
"Private Sub JobIDCombo_Change()
On Error GoTo JobIDCombo_Change_Err
Dim JobID As Long
JobID = JobIDCombo.Column(1)
If JobID > 0 Then
JobStepCombo.RowSource = "SELECT Description FROM
[JobStep] WHERE JobID = " & JobID
Else
JobStepCombo.RowSource = ""
End If
JobStepCombo.Requery
Exit Sub
JobIDCombo_Change_Err:
MsgBox Error$
End Sub"
Any help is greatly appreciated.
person and 2) Sub form for entering 1+ time logs for the
selected individual. On the Sub form, the detail section
can display multiple records. Per each detail record, a
job can be assigned as well as a corresponding job step.
Both the job and job step can be selected from drop-down
combo boxes.
I have written code to update the rowsource for my job
step combo box when the job combo is changed. The problem
is that when a user selects a different job from the combo
box, the row source for EVERY job step combo box is
changed rather than the corresponding detail record.
Code for updating rowsource:
"Private Sub JobIDCombo_Change()
On Error GoTo JobIDCombo_Change_Err
Dim JobID As Long
JobID = JobIDCombo.Column(1)
If JobID > 0 Then
JobStepCombo.RowSource = "SELECT Description FROM
[JobStep] WHERE JobID = " & JobID
Else
JobStepCombo.RowSource = ""
End If
JobStepCombo.Requery
Exit Sub
JobIDCombo_Change_Err:
MsgBox Error$
End Sub"
Any help is greatly appreciated.