In AccessXP a have a form with a combobox on it, it's recordsource is
SELECT tblCandidates.LName, tblCandidates.FName,
tblCandidates.ColUniNme, tblCandidates.Phone, tblCandidates.EMail,
tblCdtSrcsRefrds.RRDte, tblCdtSrcsRefrds.PID AS Round,
tblCdtSrcsRefrds.AppldFTInt AS Appld, tblCandidates.CID
FROM tblCandidates INNER JOIN tblCdtSrcsRefrds ON tblCandidates.CID =
tblCdtSrcsRefrds.CID
WHERE (((tblCandidates.LName) Is Not Null))
ORDER BY tblCandidates.LName, tblCdtSrcsRefrds.RRDte DESC;
In tblCandidates PID is indexed w/no dups allowed, LName is indexed
dups OK
In tblCdtSrcsRefrds PID is indexed w/no dups allowed
when opening the combobox there are two last names = Brown and they
display in this order
LName, FName, , , , , , , CID
Brown, Carolyn, , , , , , , 10072009124645
Brown, Rebecca, , , , , , , 09022009111638
If I choose Rebecca and pass the PID to a subequent form it displays
Carolyn's data in it so, in the afterupdate event of the dropdown I
stepped thru the code(debug mode) and found that the PID for Carolyn
was in the PID and not Rebecca's PID and I tried this several times
with the same result.
Why when selecting Rebecca from the dropdown is the dropdown storing
Carolyn's PID ???
thanks
bobh.
CID and PID. It gets kinda confusing. In your example, we see a bunch
of commas. No value for PID, but one for CID. And no reference to the
openform call you make so it's hard to determine what record you are
opening. Are you opening it with a filter on the PID, the CID, or LastName?
I think if you limited your SQL to necessary fields and results that
don't have a bunch of commas and your filter line (what are you passing
if you go into debug mode) it will be less confusing.
I just didn't fill in the data that was in those columns as they are
not important to this issue and the SQL is limited to what the user
needs to see in the dropdown.
When a user selects an entry from the dropdown I store the CID of the
selected entry in an invisible box on the form. The issue is if the
user selects Rebecca(which is the second 'Brown' from the dropdown
Carolyn's CID is what is getting stored via the following line of code
and I don't understand why. If I choose Rebecca and her CID is
09022009111638, that is the value I would exspect to see in
Me.cboCandidate.Column(8) and in Me.bxCID but I'm not.
Me.bxCID = Me.cboCandidate.Column(8)
bobh.
I'm not a user. :)
> When a user selects an entry from the dropdown I store the CID of the
> selected entry in an invisible box on the form. The issue is if the
> user selects Rebecca(which is the second 'Brown' from the dropdown
> Carolyn's CID is what is getting stored via the following line of code
> and I don't understand why. If I choose Rebecca and her CID is
> 09022009111638, that is the value I would exspect to see in
> Me.cboCandidate.Column(8) and in Me.bxCID but I'm not.
>
> Me.bxCID = Me.cboCandidate.Column(8)
>
> bobh.
If you had a line like
msgbox "I selected " & Me.cboCandidate.Column(8)
and commented out the assignment it returns the same CID number for both?
I was under the impression you were opening another form.
yes, I do open another form after I store the CID from the selected
record but that's not important at this point. In my original post I
was trying to give enough information to hopefully have what I was
asking make sense, but most likely I didn't.
and Yes to your question ->
>> If you had a line like
>> msgbox "I selected " & Me.cboCandidate.Column(8)
>> and commented out the assignment it returns the same CID number for both?
bobh.
I found the issue, in the after update of the dropdown I had these
lines of code
Me.btnQuit.SetFocus
Me.bxCID = Me.cboCandidate.Column(8)
Me.bxPID = Me.cboCandidate.Column(6)
Me.cboCandidate.Visible = False
after moving the 'setfocus' line
Me.bxCID = Me.cboCandidate.Column(8)
Me.bxPID = Me.cboCandidate.Column(6)
Me.btnQuit.SetFocus
Me.cboCandidate.Visible = False
the correct CID was being stored in Me.bxCID but why would doing a
setfocus first cause the value of
Me.cboCandidate.Column(8) to revert to the first entry of that Last
Name???
bobh.