Karl wrote:
"Karl" <so*****@sbcglobal.bizwrote in message
news:sX****************@nlpi069.nbdc.sbc.com...
>"MGFoster" <me@privacy.comwrote in message
news:Va******************************@earthlink.c om...
>>Karl wrote:
Using A2000 with 2 tables
Table 1 is a reference table with 2 fields
Table 2 has 2 fields and 2 combo boxes to lookup date in table 1
Combo1 binds to col 1 in table 1, this works OK
Combo 2 is set to bind to col 2 in table 1 but it always binds col 1
Column Count is set to 2 and I can see both columns in the dropdown
Bound Column is set to 2
Why would combo 2 always bind to column 1?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Are you sure that column 1 is the bound column? Here's how to find out,
use the AfterUpdate event procedure of the ComboBox:
Private Sub ComboBoxName_AfterUpdate()
MsgBox "The bound column value is: " & Me!ComboBoxName
End Sub
This will return the value of the bound column of the selected row. Is
it the value in column 1 or column 2?
If you want to hide some of the columns showing in the ComboBox's drop
down list, set the Column Width property to something like this:
Column Width: 0";3"
The above will hide the 1st column and give 3 inches of display to the
2nd column.
HTH
There isn't a form. The mdb only has 2 tables and a total of 3 records.
Main table is
FrtVendor FrtRefNo FrtAmount InventoryVendor InventoryVendorRefNo
UPS
75 M M
Lookup table is. Last col of above should be 4. Last col is set to combo,
bound col 2, col count 2
InvVendor InvRefNo InvAmt
D 6 1700
M 4 1000
The tables above didn't convert well from html to text. Here they are again
Main table
FrtVendor FrtRefNo FrtAmount InventoryVendor(LU)
InventoryVendorRefNo(LU)
UPS 75 M
M
Last col of above should be 4 or 6 depending on what user chooses(could be
multiple occurrences of InvVendor) . Last col is set to combo, bound col =
2, col count = 2
Lookup table is
InvVendor InvRefNo InvAmt
D 6 1700
M 4 1000
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You don't show your SQL statement, or do you have just the table name in
the Combo Box's RowSource property? The best bet is to have an SQL
statement like this:
SELECT InvVendor, InvRefNo FROM lookup_table
Make sure the Column Widths property has 0";1"
This will show only the InvRefNo column values in the ComboBox drop-down
list. If you want to show the InvVendor column values change the Column
Widths property to 1";0". If you want to see both values in the drop
down list use 1";1". The (") character represents inches - change to
whatever measuring system you are using.
If you have both columns showing in the drop-down list the 1st column
value will show in the ComboBox after you select a row from the drop
down list. This is a default of Access. BUT, the Bound Column value
will be saved in the table! Weird, but true.
--
MGFoster:::mgf00 <atearthlink <decimal-pointnet
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBSRVaqIechKqOuFEgEQKh7gCgz3FOgK9yz5SDNpjY449oGq 8/9B0An2y9
krL3Mh32KaaxEFDWfy6iIeHA
=FVgU
-----END PGP SIGNATURE-----