By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,401 Members | 928 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,401 IT Pros & Developers. It's quick & easy.

Sychronized Combo Boxes - Mystery of Missing Values

P: n/a
Hello,

I have 2 tables:

Product_List

Product_ID (PK)
Product_Name
Client_ID

and

Client_List

Client_ID (PK)
Client_Name

They are linked from Client_ID in Client_List to Client_ID in
Product_List.

On my form I have 2 combo boxes, the first is unbound and simply looks
up the Client_Names from the Client_List table.

It has an after_update event of:

Private Sub Client_Name_AfterUpdate()

Product_Name.RowSource = "Select Product_Name from Product_List " _
& "where Client_ID=" & Client_Name
End Sub

CB2 (Product_Name) has a record source of Product_Name where I need it
to be stored.

Now this all appears to be working, apart from that when I pull down
on the Product_Name Combo Box the fields are all blank. Even stranger
is that the correct amount of products for that client can be seen by
the amount it highlights as you move the mouse up and down the list!

I've got the bound column set to '2' as that is the product name
column in the table (product_list)

Anyone seen this before, or am I being stupid?!

Much appreciated in advance,

Chris.
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If there is only one column in the Product_Name ComboBox you can't set
the Bound Column to 2, it has to be set to 1.

The Product_Name ComboBox's Rowsource is incorrect, 'cuz you're trying
to compare the Client_ID to the Client_Name:

Client_ID Client_Name
25 = "Mary Lou"

Obviously, a number does NOT equal a string.

If you want to store the Product_ID the RowSource property of the
Product_Name ComboBox should be like this:

"SELECT Product_ID, Product_Name FROM Product_List " & _
"WHERE Client_ID=" & Me!Client_ID

You have to have a control named "Client_ID" for that to work.

Then the ComboBox's Properties need to look like this:

Column Count: 2
Column Widths: 0";1.5"
Row Source Type: Table/Query
Bound Column: 1
Limit to List: Yes
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQlV4TYechKqOuFEgEQJHJwCg1LmqBfaUK8BNRuQaYjPU4h 1V+RMAn2/r
W7MJMhk8Or6DU89PearqJnu7
=EBoG
-----END PGP SIGNATURE-----
ClarCE wrote:
Hello,

I have 2 tables:

Product_List

Product_ID (PK)
Product_Name
Client_ID

and

Client_List

Client_ID (PK)
Client_Name

They are linked from Client_ID in Client_List to Client_ID in
Product_List.

On my form I have 2 combo boxes, the first is unbound and simply looks
up the Client_Names from the Client_List table.

It has an after_update event of:

Private Sub Client_Name_AfterUpdate()

Product_Name.RowSource = "Select Product_Name from Product_List " _
& "where Client_ID=" & Client_Name
End Sub

CB2 (Product_Name) has a record source of Product_Name where I need it
to be stored.

Now this all appears to be working, apart from that when I pull down
on the Product_Name Combo Box the fields are all blank. Even stranger
is that the correct amount of products for that client can be seen by
the amount it highlights as you move the mouse up and down the list!

I've got the bound column set to '2' as that is the product name
column in the table (product_list)

Anyone seen this before, or am I being stupid?!

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.