473,734 Members | 2,211 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combo box problem

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?


Nov 6 '08 #1
4 2472
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_Af terUpdate()

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
--
MGFoster:::mgf0 0 <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/AwUBSROAH4echKq OuFEgEQI90QCfYW klLaud0mU3c+/PBfvcVeFXJ4cAoK u/
ePSp6+Wq/G11E7fRS9aZpqom
=whhI
-----END PGP SIGNATURE-----
Nov 6 '08 #2

"MGFoster" <me@privacy.com wrote in message
news:Va******** *************** *******@earthli nk.com...
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_Af terUpdate()

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 InventoryVendor RefNo
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


Nov 7 '08 #3

"Karl" <so*****@sbcglo bal.bizwrote in message
news:sX******** ********@nlpi06 9.nbdc.sbc.com. ..
>
"MGFoster" <me@privacy.com wrote in message
news:Va******** *************** *******@earthli nk.com...
>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_Af terUpdate()

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 InventoryVendor RefNo
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)
InventoryVendor RefNo(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
>


Nov 7 '08 #4
Karl wrote:
"Karl" <so*****@sbcglo bal.bizwrote in message
news:sX******** ********@nlpi06 9.nbdc.sbc.com. ..
>"MGFoster" <me@privacy.com wrote in message
news:Va******* *************** ********@earthl ink.com...
>>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_Af terUpdate()

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 InventoryVendor RefNo
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)
InventoryVendor RefNo(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:::mgf0 0 <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/AwUBSRVaqIechKq OuFEgEQKh7gCgz3 FOgK9yz5SDNpjY4 49oGq8/9B0An2y9
krL3Mh32KaaxEFD Wfy6iIeHA
=FVgU
-----END PGP SIGNATURE-----
Nov 8 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4281
by: Heather | last post by:
Hi I am desparately looking for advice in relation to storing the results after selecting items from two combo boxes on a Referral form. The first combo box 'ctl Type' displays a full list of Agency Types, then the 2nd combo box displays a list of Organisations, depending upon the Agency Type Selected. The first combo box 'ctlType' (Unbound), Row Source: to field in 'AgencyReferralType'.
1
4149
by: Jeff Smith | last post by:
Hi This is a repost due to no responses Here's a problem I've encountered with Access 2003 which has got me to redesign how I get the row source in a second combo box using the first combo box as a filter. In Access 2002 and earlier the row source for the second combo was "SELECT Field1, Field2 etc, FROM MyTable WHERE Field3 =
9
6761
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the second combo to change depending on what values the user selects in the first box, it's just that every time the user changes the first combobox, the second combobox FOR EVERY RECORD goes blank.
7
1850
by: Ausclad | last post by:
Ok, ill try again..... It seems fairly simple. I have two combo boxes in a datagrid. The datagrid is bound to a a table in a dataset. The two combo boxes are bound to a single data table in a different dataset. One combo box is displaying the Employees payroll ID. The other is
1
3102
by: lawton | last post by:
Source: this is an access 2003 question My knowledge level: reading books, internet, and trial & error; no formal training I'm trying to get a running sum of what's filtered in a subform which is ultimately driven by the results of two combo boxes: 1st combo box on main form that filters desired results for 2d combo box on sub form Main form: no record source. Has an unbound combo box. name: frminput combo name: cboAccounts The row...
4
2361
by: Dave | last post by:
I wasn't sure how to search for previous posts about this, it felt real specific. Ok so here's the database & problem: I have 4 combo boxes: cboServer, cboPolicy, cboDB, and cboApplication. The idea behind the database is for a user to search/ select desired information in any kind of combination between the 4 combo boxes. Then the user clicks a button (btnSearch) and subsequently a query ("Search Function") is run that shows all 4...
2
7047
by: biganthony via AccessMonster.com | last post by:
Hi, I decided to install Office 2003 Service Pack 3 on my home computer to test (in full knowledge that there may be some issues with it). After installation, I have noticed that with a small database I wrote for home, the combo boxes and listboxes no longer display the bound column. For example, on a form I have a combo box based on a table called 'names'. The two columns in the combo box are ID and Surname. The combo box and list box...
3
1979
rhitam30111985
by: rhitam30111985 | last post by:
Hi all.. i am trying to create a combo with the pop down list being modfied in real time as i type each character : import gtk window=gtk.Window(gtk.WINDOW_TOPLEVEL) window.connect("destroy",gtk.main_quit) combo=gtk.Combo() combo.set_use_arrows(True) wordlist= def entry_callback(widget,combo):
6
1875
by: =?Utf-8?B?amVmZmVyeQ==?= | last post by:
i need help with a combo box and this same code works on my first tab with a combo box. The error or problem i have is this code causes an index out of range error when i run it on my second combo box: (errored code) Select Case ComboBox2.text Case Is ="Execute Program" 'code to execute program here Case Is ="Other Command that executes code at a certain time" ' code below the same as above except that it works But not my first(this...
3
3006
by: evenlater | last post by:
Using Access 2007, I've found that combo box back colors change to transparent from normal inconsistently for no reason I can discern. Never had that problem in previous versions of Access. I do have the back style properties set to Normal and back colors set to white, but sometimes when I tab out of a particular combo box the back color changes to match the back color of the detail section. Has anybody else had this experience? Is there...
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9182
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.