A
Anne
I have 2 combos on a continuous form which records a pour.
A pour can have several jobs, each job can have several joists.
The object is to select a job (which works) then select a joist form the
cboJoistSelect.
A job may be listed 3 or 4 time with a different joist. As long as I have
only one job, everything works well. As soon as I select a second job, the
cboJoistSelect for the first job goes blank, even though the joist was
actually recorded (visible joistID field for debugging purpose).
The joistID comes from the TblJoist and it is a Autonumberfield and it is a
unique for the Joist and Job.
When I look at the cboJoistSelect (see below) it now lists the 2nd jobID. I
would think that each line should show its own JobID. It must be the code,
which I copied from a sample. What is wrong with the below code, what
changes do I have to make, to make each joist stick with its JobID on the
same line?
Both combos are bound.
cboJobSelect (looking for Job)
SELECT cboJobsActive.JobID, cboJobsActive.JobNoName, cboJobsActive.JobNo
FROM cboJobsActive ORDER BY JobNo;
Private Sub cboJobSelect_AfterUpdate()
Dim sJoistSource As String
sJoistSource = "SELECT [tblJoists].[JoistID], [tblJoists].[JoistNo],
[tblJoists].[JobID] " & _
"FROM tblJoists " & _
"WHERE [JobID] = " & Me.cboJobSelect.Value
Me.cboJoistSelect.RowSource = sJoistSource
Me.cboJoistSelect.Requery
End Sub
cboJoistSelect (looking for Joist)
SELECT tblJoists.JoistID, tblJoists.JoistNo, tblJoists.JobID FROM tblJoists
WHERE [jobID]=232;
JobId=232 is the result of the first AfterUpdate Event.
thanks,
Anne
A pour can have several jobs, each job can have several joists.
The object is to select a job (which works) then select a joist form the
cboJoistSelect.
A job may be listed 3 or 4 time with a different joist. As long as I have
only one job, everything works well. As soon as I select a second job, the
cboJoistSelect for the first job goes blank, even though the joist was
actually recorded (visible joistID field for debugging purpose).
The joistID comes from the TblJoist and it is a Autonumberfield and it is a
unique for the Joist and Job.
When I look at the cboJoistSelect (see below) it now lists the 2nd jobID. I
would think that each line should show its own JobID. It must be the code,
which I copied from a sample. What is wrong with the below code, what
changes do I have to make, to make each joist stick with its JobID on the
same line?
Both combos are bound.
cboJobSelect (looking for Job)
SELECT cboJobsActive.JobID, cboJobsActive.JobNoName, cboJobsActive.JobNo
FROM cboJobsActive ORDER BY JobNo;
Private Sub cboJobSelect_AfterUpdate()
Dim sJoistSource As String
sJoistSource = "SELECT [tblJoists].[JoistID], [tblJoists].[JoistNo],
[tblJoists].[JobID] " & _
"FROM tblJoists " & _
"WHERE [JobID] = " & Me.cboJobSelect.Value
Me.cboJoistSelect.RowSource = sJoistSource
Me.cboJoistSelect.Requery
End Sub
cboJoistSelect (looking for Joist)
SELECT tblJoists.JoistID, tblJoists.JoistNo, tblJoists.JobID FROM tblJoists
WHERE [jobID]=232;
JobId=232 is the result of the first AfterUpdate Event.
thanks,
Anne