dbTalk Databases Forums  

help with combobox

comp.databases.ms-access comp.databases.ms-access


Discuss help with combobox in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bobh
 
Posts: n/a

Default help with combobox - 01-04-2010 , 10:43 AM






Hi,

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.

Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: help with combobox - 01-04-2010 , 11:05 AM






bobh wrote:

Quote:
Hi,

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.

Reply With Quote
  #3  
Old   
bobh
 
Posts: n/a

Default Re: help with combobox - 01-04-2010 , 01:04 PM



On Jan 4, 11:05*am, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:
Quote:
bobh wrote:
Hi,

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.- Hide quoted text -

- Show quoted text -

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.

Reply With Quote
  #4  
Old   
Salad
 
Posts: n/a

Default Re: help with combobox - 01-04-2010 , 01:26 PM



bobh wrote:

Quote:
On Jan 4, 11:05 am, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

bobh wrote:

Hi,

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.- Hide quoted text -

- Show quoted text -



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.
I'm not a user.

Quote:
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.

Reply With Quote
  #5  
Old   
bobh
 
Posts: n/a

Default Re: help with combobox - 01-04-2010 , 02:09 PM



On Jan 4, 1:26*pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:
Quote:
bobh wrote:
On Jan 4, 11:05 am, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

bobh wrote:

Hi,

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 tothe
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.- Hide quoted text-

- Show quoted text -

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.

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.- Hide quoted text -

- Show quoted text -
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 ->

Quote:
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.

Reply With Quote
  #6  
Old   
bobh
 
Posts: n/a

Default Re: help with combobox - 01-04-2010 , 02:21 PM



On Jan 4, 2:09*pm, bobh <vulca... (AT) yahoo (DOT) com> wrote:
Quote:
On Jan 4, 1:26*pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:





bobh wrote:
On Jan 4, 11:05 am, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

bobh wrote:

Hi,

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 abunch
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.- Hide quoted text -

- Show quoted text -

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.

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.- Hide quoted text -

- Show quoted text -

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.- Hide quoted text -

- Show quoted text -
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.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.