473,386 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Combo box jumps to values when duplicates

Hi,

Can someone please help? I have never seen this happening before:

I have a combo box on a form whose source is the following query:

SELECT [tblEmployees].[EmpNumber], [tblEmployees].[Surname]
FROM tblEmployees LEFT JOIN tblLaserscanmessungen_test ON
[tblEmployees].[EmpNumber]=[tblJobs].[EmpNumber]
WHERE ((Not ([tblJobs].[EmpNumber]) Is Null) And (Not
([tblMeasurementsType1].[BodySize]) Is Null And Not
([tblMeasurementsType1].[BodySize])=IsEmpty([BodySize])))
ORDER BY [tblEmployees].[EmpNumber] DESC;

What is happening here is that I display a list of Employees as
follows:

EmpNumber Surname
--------- --------
615 Smith
616 Jones
617 Smith
618 Brown

When I click on the combobox dropdown arrow, the above list displays
correctly. The value that is displayed in the combo box when I click
one of the entries is ONLY the EmpNumber.

The problem is e.g. when I select "615 Smith" (where there are more
than one "Smith" but they have unique EmpNumber's) then after clicking,
the value displayed automatically changes to "617".

I cannot figure out why this is happening, anybody?

Regards,
Jean

Nov 13 '05 #1
2 1337
Suggestions:

1. Try adding a DISTINCT to the SELECT statement, i.e.:
SELECT DISTINCT [tbl...

2. Any code in the AfterUpdate event of the combo?
If so, try temporarily deleting it.

3. If neither of these solve the problem, check which version of JET you
have on your computer. In the Windows Explorer, search for msjet40.dll
(assuming Access 2000 or above). Typically it is in windows\system32.
Right-click, and choose Properties. On the Version tab, you should see:
4.0.8xxx.0
The numbers at xxx do not matter, but if you do not see the 8, download SP8
for JET 4 from:
http://support.microsoft.com/kb/239114

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jean" <je**********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Can someone please help? I have never seen this happening before:

I have a combo box on a form whose source is the following query:

SELECT [tblEmployees].[EmpNumber], [tblEmployees].[Surname]
FROM tblEmployees LEFT JOIN tblLaserscanmessungen_test ON
[tblEmployees].[EmpNumber]=[tblJobs].[EmpNumber]
WHERE ((Not ([tblJobs].[EmpNumber]) Is Null) And (Not
([tblMeasurementsType1].[BodySize]) Is Null And Not
([tblMeasurementsType1].[BodySize])=IsEmpty([BodySize])))
ORDER BY [tblEmployees].[EmpNumber] DESC;

What is happening here is that I display a list of Employees as
follows:

EmpNumber Surname
--------- --------
615 Smith
616 Jones
617 Smith
618 Brown

When I click on the combobox dropdown arrow, the above list displays
correctly. The value that is displayed in the combo box when I click
one of the entries is ONLY the EmpNumber.

The problem is e.g. when I select "615 Smith" (where there are more
than one "Smith" but they have unique EmpNumber's) then after clicking,
the value displayed automatically changes to "617".

I cannot figure out why this is happening, anybody?

Regards,
Jean

Nov 13 '05 #2
Thanks for the reply Allen.

I tried something else, namely changing the BoundColumns property of
the ComboBox from 2 down to 1.
Can't believe it was something like that.

Regards
Jean

Nov 13 '05 #3

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

Similar topics

8
by: PeteCresswell | last post by:
I'm looking for some code that makes a list presented in a subform autoscroll in response to the user typing - like a combo box dropdown or a regular ListBox does. I.e. The user is looking at...
3
by: dmkeith2 | last post by:
I have a table for all my combox boxes. ID: AutoNumber ComboName: text ComboValue: text with no duplicates I have create a query based on this table. I have also created two forms based on...
15
by: sara | last post by:
Hi I'm pretty new to Access here (using Access 2000), and appreciate the help and instruction. I gave myself 2.5 hours to research online and help and try to get this one, and I am not getting...
9
by: Bob Alston | last post by:
I have a drop down combo box that gives the user to enter an item not in the list by adding it to the list. The list is a table. It works fine on Access2003 but fails on Access2002/XP. ON XP, it...
9
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...
2
by: fstenoughsnoopy | last post by:
I have a customer order database and I need to pull a customers information, ie first name, last name, address, city, state, zip, phone, etc, into the oder table. i don't know how to go about...
1
by: RICHARD BROMBERG | last post by:
I have a form with a combo box. It is in the first Tab Stop when the form opens. The dropdown area should be immediately below the combo box as all others on the form, but it isn't. The...
4
by: virtualgreek | last post by:
Dear All, First of all I would like to take the time to thank you all for your efforts and time spent at this wonderful forum. I have found it very helpful with numerous examples available for...
0
Cathode Follower
by: Cathode Follower | last post by:
When you populate a combo you load it with data that normally comes in the form of a code and a description - but the combo is only interested in the description. By creating a class derived from a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.