473,788 Members | 2,725 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Select duplicate names from listbox

3 New Member
Hi All,
Need some help with a listbox display to textbox...After loading my listbox from the database, I need to be able to select duplicate names and display them in a textbox....it works fine on the first name but if there is a duplicate last name it still displays the first one no matter which one you click.....below is the code I am trying to use.......Pleas e any help would be appreciated.... ....

Set RS = db.OpenRecordse t("Select * from retmem where [lname] = '" & Trim(list1.list (list1.ListInde x)) & "'")

txtfirst.Text = RS("fname")
txtlast.Text = RS("lname")
Oct 16 '07 #1
3 1760
gilsygirl
25 New Member
Hi All,
Need some help with a listbox display to textbox...After loading my listbox from the database, I need to be able to select duplicate names and display them in a textbox....it works fine on the first name but if there is a duplicate last name it still displays the first one no matter which one you click.....below is the code I am trying to use.......Pleas e any help would be appreciated.... ....

Set RS = db.OpenRecordse t("Select * from retmem where [lname] = '" & Trim(list1.list (list1.ListInde x)) & "'")

txtfirst.Text = RS("fname")
txtlast.Text = RS("lname")

Hi Jerry

Have u tried using the SEEK Method where u can specifically search the field from the database base on its index.

Good luck
Oct 17 '07 #2
debasisdas
8,127 Recognized Expert Expert
Try to use DISTINCT or UNIQUE key word in the SQL statment to filter the duplicate values.
Oct 17 '07 #3
jerrys57
3 New Member
Hi Jerry

Have u tried using the SEEK Method where u can specifically search the field from the database base on its index.

Good luck
Thank you, but I am not sure of the code format for the seek with index, do you have an example ..thanks so much........Jer ry
Oct 25 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
11509
by: malcolm | last post by:
Example, suppose you have these 2 tables (NOTE: My example is totally different, but I'm simply trying to setup the a simpler version, so excuse the bad design; not the point here) CarsSold { CarsSoldID int (primary key) MonthID int DealershipID int NumberCarsSold int
14
2938
by: Jos? | last post by:
This one droves me completely mad. I did not succeed to exploit the track given to me by Bob. I have : three tables : Clubs, Persons and ClubsPersons that join the two first in a many to many relationship. Club has two (2) fields : ClubId (Autonumber) and ClubName (Text). Peoples has two(2) fields : (PersonId (Autonumber) and PersonName (Text) ClubsPersons has two (2) fields : ClubId (LongInteger) and PersonId
5
2463
by: Melissa Cowan | last post by:
I am using Access 2000. I have the Developer's handbook and got the code for the mulit select listbox from there. It sends the selected value to another listbox, lstselected. What I need to do is loop through there and add each item to a table. I can add the other info fromt he form to a table, just not the otems in the listbox. It only shows as 0. I tried using the varItem and it told me that the action is not supported. I'm a bit rusty...
1
4240
by: pcb | last post by:
Hi All, I have a multi-select listbox, that can have duplicate items (i.e samples numbers that are analyzed in duplicate - the sample IDs are not the same, but these IDs are hidden from the user). I want to loop through the items on the listbox, but only use unique sample numbers. Here is what I have:
2
1802
by: Arnold | last post by:
Greetings Gurus, In a report showing the names of students and their progress, I am getting an error in the name field (Name: #Error). The report gets its data from an unbound form containing two unbound textboxes, "txtStartDate" and "txtEndDate," and a multi-select listbox, "listName." I think the error occurs when there is no correct combination of data--for instance, no records for John Doe entered during this past week.
1
5638
by: Melson | last post by:
Hi Can anyone give suggestions please. I need to create a list (probably using listbox) and fill with names in the listbox. When I enter a name (maybe Adam) in a program (notepad, MS words, other program), the list of names appear. How can I select the name in the listbox with the keyboard if i want to select the eighth name in the list. How can I make the listbox appear when I enter the first 2 characters in the
10
1793
by: SanMiguel12 | last post by:
Hi, I have a huge problem which drives crazy for a month... I am working on a database program and I am using .net2005 and Sql server 2003. In a form I have a listbox and two texboxes and there's also in my database a table with three sells: "name", "e-mail" and "address". The listbox shows the "name" and I want when I choose a name, the two textboxes to show the other two sells ("name","address") that goes for the name i chose in the...
5
12328
by: OldBirdman | last post by:
I am attempting to assign a .RowSource to a ListBox using an SQL statement. I want to build the SQL statement "On-the-Fly", based on values in several controls on the form. I would like to restrict this discussion to Native Access, because when these discussions get beyond this, I don't understand, I cannot make them work, or I don't have the necessary resources. For this question, I have built a simple DataBase, an AddressBook, because...
3
3267
by: 6afraidbecause789 | last post by:
If able, can someone please help make a Where clause that strings together IDs in a multi-select listbox AND includes a date range. I wasn’t thinking when I used the code below that strings together the IDs of Clients from a multi-select listbox in an unbound text field, txtCriteria, on a form that is used to pick different reports. It appears that I now have so many clients that I’ve reached the 255 character limit in the txtCriteria...
0
9656
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
9498
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
10366
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
10173
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
9967
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
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
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
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.