C
cb
Hello,
I am setting up a training data base for my work. On one of my forms I want
the I want to be limit the required trainings based on the employees job
title. I can get the queries to work, but every time I enter the code that
has been suggested by others I get module not found. Here is the information
for you:
cboJobTitleID
Row Source
SELECT DISTINCT Jobs.* FROM Jobs ORDER BY Jobs.JobName;
cboRequiredTrainingID
Row Source
SELECT RequiredTraining.ID, RequiredTraining.JobTitleID,
RequiredTraining.Training FROM RequiredTraining WHERE
(((RequiredTraining.JobTitleID)=forms![Required Training and
Employee]!cboJobTitleID)) ORDER BY RequiredTraining.Training;
Here is the code I have tried:
Private Sub Form_Current()
Me.cboRequiredTrainingID.Requery
End Sub
Private Sub JobTitleID_AfterUpdate()
Me.cboRequiredTrainingID.Requery
End Sub
And (which I found for bound combo boxes, which I have)
Private Sub cboJobTitleID_AfterUpdate()
cboRequiredTrainingID = Null
cboRequiredTrainingID.Requery
cboRequiredTrainingID = Me.cboRequiredTrainingID.ItemData(0)
End Sub
Private Sub Form_Current()
cboRequiredTrainingID.Requery
End Sub
Private Sub Form_Load()
If IsNull(cboJobTitleID) Then
cboJobTitleID = Me.cboJobTitleID.ItemData(0)
Call cboJobTitleID_AfterUpdate
End If
End Sub
I would appreciate any help that you could give me. I am sure there is a
simple solution that I am too "green" to know.
Thanks,
Chris
I am setting up a training data base for my work. On one of my forms I want
the I want to be limit the required trainings based on the employees job
title. I can get the queries to work, but every time I enter the code that
has been suggested by others I get module not found. Here is the information
for you:
cboJobTitleID
Row Source
SELECT DISTINCT Jobs.* FROM Jobs ORDER BY Jobs.JobName;
cboRequiredTrainingID
Row Source
SELECT RequiredTraining.ID, RequiredTraining.JobTitleID,
RequiredTraining.Training FROM RequiredTraining WHERE
(((RequiredTraining.JobTitleID)=forms![Required Training and
Employee]!cboJobTitleID)) ORDER BY RequiredTraining.Training;
Here is the code I have tried:
Private Sub Form_Current()
Me.cboRequiredTrainingID.Requery
End Sub
Private Sub JobTitleID_AfterUpdate()
Me.cboRequiredTrainingID.Requery
End Sub
And (which I found for bound combo boxes, which I have)
Private Sub cboJobTitleID_AfterUpdate()
cboRequiredTrainingID = Null
cboRequiredTrainingID.Requery
cboRequiredTrainingID = Me.cboRequiredTrainingID.ItemData(0)
End Sub
Private Sub Form_Current()
cboRequiredTrainingID.Requery
End Sub
Private Sub Form_Load()
If IsNull(cboJobTitleID) Then
cboJobTitleID = Me.cboJobTitleID.ItemData(0)
Call cboJobTitleID_AfterUpdate
End If
End Sub
I would appreciate any help that you could give me. I am sure there is a
simple solution that I am too "green" to know.
Thanks,
Chris