473,800 Members | 2,731 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multi-list box help!

Joe
I have the following 3 tables:

Clients, which has a numeric PK field called CLIENT_ID

Languages, which has a numeric PK field called LANGUAGE_ID

Client_Language s, which has a unique PK and foreign key fields
CLIENT_ID and LANGUAGE_ID

Clients and Languages each have a one-to-many relationship with
Client_Language s.

My form displays all the information in the Clients table, it also
contains a multi-list box containing all the values in the Languages
table.

When I cycle through my records I want to query the Client_Language s
table based on Client_ID and highlight each entry in multi-list box for
the current client record.

I currently have this function which does not work at all:

Private Sub Form_Current()
'Clear out any previous values
For x = 0 To Me!Languages_Sp oken.ListCount - 1
Me!Languages_Sp oken.Selected(x ) = False
Next x

If Me![client id] > 0 Then

'Populate list box with saved values (if any exist)
For x = 0 To Me!Languages_Sp oken.ListCount - 1

If Me!Languages_Sp oken.ItemData(x ) = DLookup("LANGUA GE_ID",
"CLIENT_LANGUAG ES", "CLIENT_ID = " & Me![client id]) Then
Me!Languages_Sp oken.Selected(x ) = True

Next x

End If

End Sub

Nov 13 '05 #1
1 2728
Doesn't work at all?
Or highlights only one item?

DLookup always returns the first match, so it might not be the best choice
in this case.
If you're not getting any matches at all, I'd check whether ItemData is
returning the data displayed in your listbox, or a hidden ID column.

If none of this is enough to help, please post back with more detailed
questions.
"Joe" <jc**********@c omcast.net> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I have the following 3 tables:

Clients, which has a numeric PK field called CLIENT_ID

Languages, which has a numeric PK field called LANGUAGE_ID

Client_Language s, which has a unique PK and foreign key fields
CLIENT_ID and LANGUAGE_ID

Clients and Languages each have a one-to-many relationship with
Client_Language s.

My form displays all the information in the Clients table, it also
contains a multi-list box containing all the values in the Languages
table.

When I cycle through my records I want to query the Client_Language s
table based on Client_ID and highlight each entry in multi-list box for
the current client record.

I currently have this function which does not work at all:

Private Sub Form_Current()
'Clear out any previous values
For x = 0 To Me!Languages_Sp oken.ListCount - 1
Me!Languages_Sp oken.Selected(x ) = False
Next x

If Me![client id] > 0 Then

'Populate list box with saved values (if any exist)
For x = 0 To Me!Languages_Sp oken.ListCount - 1

If Me!Languages_Sp oken.ItemData(x ) = DLookup("LANGUA GE_ID",
"CLIENT_LANGUAG ES", "CLIENT_ID = " & Me![client id]) Then
Me!Languages_Sp oken.Selected(x ) = True

Next x

End If

End Sub

Nov 13 '05 #2

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

Similar topics

4
4678
by: Frank Jona | last post by:
Intellisense with C# and a multi-file assembly is not working. With VB.NET it is working. Is there a fix availible? We're using VisualStudio 2003 Regards Frank
12
3882
by: * ProteanThread * | last post by:
but depends upon the clique: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=954drf%24oca%241%40agate.berkeley.edu&rnum=2&prev=/groups%3Fq%3D%2522cross%2Bposting%2Bversus%2Bmulti%2Bposting%2522%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den ...
0
3791
by: frankenberry | last post by:
I have multi-page tiff files. I need to extract individual frames from the multi-page tiffs and save them as single-page tiffs. 95% of the time I receive multi-page tiffs containing 1 or more black and white CCITT4 compressed files (frames) inside the tiff. Every now and then I receive a mixture of black and white CCITT4 and JPEG compressed files, and sometimes just multi-page tiffs with JPEG only. The code runs great when dealing with the...
6
8185
by: cody | last post by:
What are multi file assemblies good for? What are the advantages of using multiple assemblies (A.DLL+B.DLL) vs. a single multi file assembly (A.DLL+A.NETMODULE)?
5
6002
by: Shane Story | last post by:
I can seem to get the dimensions of a frame in a multiframe tiff. After selecting activeframe, the Width/Height is still really much larger than the page's actual dimensions. When I split a TIFF to several PNG files this causes a problem, becuase the resulting image is (the page to the far left and a lot of black space surrounding it and a filesize that is larger than needed. Any ideas?
5
5772
by: bobwansink | last post by:
Hi, I'm relatively new to programming and I would like to create a C++ multi user program. It's for a project for school. This means I will have to write a paper about the theory too. Does anyone know a good place to start looking for some theory on the subject of multi user applications? I know only bits and pieces, like about transactions, but a compendium of possible approches to multi user programming would be very appreciated!
0
2331
by: Sabri.Pllana | last post by:
We apologize if you receive multiple copies of this call for papers. *********************************************************************** 2008 International Workshop on Multi-Core Computing Systems (MuCoCoS'08) Barcelona, Spain, March 4 - 7, 2008; in conjunction with CISIS'08. <http://www.par.univie.ac.at/~pllana/mucocos08> *********************************************************************** Context
1
9321
by: mknoll217 | last post by:
I am recieving this error from my code: The multi-part identifier "PAR.UniqueID" could not be bound. The multi-part identifier "Salary.UniqueID" could not be bound. The multi-part identifier "PAR.UniqueID" could not be bound. The multi-part identifier "PAR.PAR_Status" could not be bound. The multi-part identifier "Salary.New_Salary" could not be bound. The multi-part identifier "Salary.UniqueID" could not be bound. The multi-part...
14
3414
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
As far as I know, the C Standard has no mention of multi-threaded programming; it has no mention of how to achieve multi-threaded programming, nor does it mention whether the language or its libraries are suitable for multi-threaded programming. For people who are fond of portable C programming, what's the best way to go about multi-threaded programming? I've been reading up on POSIX threads a little, they seem pretty ubiquitous....
4
7332
by: =?Utf-8?B?SGVucmlrIFNjaG1pZA==?= | last post by:
Hi, consider the attached code. Serializing the multi-dimensional array takes about 36s vs. 0.36s for the single-dimensional array. Initializing the multi-dimensional array takes about 4s vs. 0.3s for the single-dimensional array. (I know initializing is not necessary in this simple example,
0
9690
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
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10504
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
10274
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
10033
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
9085
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...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
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

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.