2 Combos not behaving

  • Thread starter Thread starter Anne
  • Start date Start date
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
 
Hi,


In a continuous design, the combo boxes all share the same list than the
list of the "current" record. There is not much we can do about it, since it
is "by design".


Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top