Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > combobox display from a table


Reply
 
Thread Tools Display Modes
  #1  
Old 02-01-2004, 11:57 AM
vic_12 vic_12 is offline
Newcomer
 
Join Date: Feb 2004
Posts: 4
Default combobox display from a table


hi!!!!

could any one help me display my combobox.

i have 2 tables

1. namelist
- recordid
- fname
- lname
- religion

2. religion
-religionid
religion

1st there are data in the religion table. my form is connected to the first table with a combobox in religion which i want to show the select in the 2nd table. im using ADO and access. i have already made a relationship between the 2 tables(religion-religion)

thanks
Reply With Quote
  #2  
Old 02-01-2004, 12:20 PM
TheDutch IceMan TheDutch IceMan is offline
Junior Contributor
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 334
Default

Your relation should be religionID.

Do Until objRs.EOF
Me.lstReligion.AddItem objRs!religion
lstReligion.ItemData(lstReligion.NewIndex) = objRs!religionID
objRs.MoveNext
Loop

Now you can use the lstReligion.ItemData(lstReligion.NewIndex)
For example when the user clicks the list, the ItemData will be selected and perhaps added (after an insert or update statement) in the first table.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling contents of a table using combobox angelfish0517 Database and Reporting 5 01-26-2004 01:58 AM
urgent: combobox and database table DanHa Database and Reporting 2 09-30-2003 12:57 PM
multiple table joins simflex Database and Reporting 2 08-16-2003 04:18 PM
How to display XML file in a table? gar3th_jon3s General 2 06-12-2003 07:40 AM
Combo makes RTB`s visible? golash General 2 11-27-2000 02:16 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->