473,787 Members | 2,934 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use combo box with adodc to retrive field in access database.

I have access database which I willuse form to retrieve a field to
show in List of combo box.

the method that I use now is adodb code when form load is show below.

Private Sub Form_Load()
Dim sql As String
Dim i As Integer

StrConn = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" & App.Path &
"\master.mdb;Pe rsist Security Info=False"

With Cn
If .State = adStateOpen Then .Close
.ConnectionStri ng = StrConn
.ConnectionTime out = 90
.CursorLocation = adUseClient
.Open
End With

sql = "SELECT * FROM Room"
Rs.Open sql, Cn, adOpenDynamic, adLockOptimisti c, adCmdText

' in this section, I will load the CustomerID to show in this form in
combo box.
cboCustomerID.C lear
For i = 1 To Rs.EOF
cboCustomerID.A ddItem !rs.("customeri d")

Next
' but it's still not work yet.
' the code below is not work anyway.. I'm still confuse the exactly
way to coding..
' With Rs
' Do Until .EOF
' cboCustomerID.A ddItem !roomid
' .MoveNext
' Loop
' End With

Call DisplayData 'this is an sub routine that will retrieve data from
field in database to show in textbox in my form. the most coding in
this section is txtroomid = rs("roomid")
.....
End Sub

please help me, I really want to show data in combo box
Jul 17 '05 #1
0 4013

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

Similar topics

8
18397
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". The values in the dropdown are loaded in the correct order, but the initial value is not the first row of the dropdown as I expected. The field "CategoryName" is not the primary key for the table -- the PK is
4
6133
by: LD | last post by:
Is there a way in Access to store more than one value in a field that has been selected from a combo box? For example, if a combo box had three values that you can select, "One", "Two", and "Three". How do you drop down the list and select a first value ("One") then do the same and select a second value ("Two") so that the value in the field is now "One, Two". I have situations where I need to do this with fields that If there is a...
1
6130
by: sara | last post by:
I am learning how to use simple functions to make my apps more powerful and efficient. On one screen, I want to populate field B: ItemDescription by looking up the ItemDescription in the Items Table. I would use the key to the Items Table from the selection the user made in the combo box. SO: User chooses an item from the combo box whose value is "3". I want to look up the ItemDescription of the Item with the Key "3" and show that...
8
2203
by: AA Arens | last post by:
Hi I do have a products table and products-parts table in my Access 2003 database and log all services into a form. I do have at least the following two combo boxes on my form: - Choose Product where as the Row Source (See properties): SELECT tblProducts.ProductName, tblProducts.ProductName FROM tblProducts ORDER BY ProductName;
2
1135
by: hari kumar | last post by:
sir, I have some about the codings of combo&listboxes. first is when i select the combo then all the fields are automatically displayed. next is when i click the listbox then all the files including the combo is displayed. I am always using in ADODC component to connect the fields. how we use only in ADODC connection without placing ADODC component in the form. Please help me . This is very urgent Thanking You ...
23
3424
nehashri
by: nehashri | last post by:
hi i am designing a database using Ms Access and ASP. i have 3 tables in access namely 'PERSONAL', other as 'POLICY' and 3rd one is named as 'STAFF'. in the contact table i have ID, Name, Children as fields. Also in policy table the firlds are:- ID, date_of_policy, no_policy, amount_paid, amount_balance and similarly the 3rd ie., staff has few fields. all three are linked my a common field which is ID all i want is when the user searches...
1
1670
by: imwhiteandnerdy | last post by:
i'm hoping I can get some help with adding my combo box selection to my access database.Any Help would be appreciated. I've been told I need complex binding Basically I just want to add the selection to the database field DATABASE =cc TABLE =customer FIELD IN DATABASE= custCity COMBO BOX =cboCity My combo box name is cboCity Has the following collection of items linked
2
7049
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...
9
3325
by: Neelesh2007 | last post by:
Hi All, I have developed project in VB6.0 with access as backend.I have used ADODC control in VB to retrieve data from access. I have created the Setup file by Package & Deployment. Now when i install the software on other PC whole program works fine but ADODC can not establish connection with database. Then if I install VB6.0 then only ADODC works. Can any body guide me how can i create set-up file so that i can install my software without...
0
9655
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
10363
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...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6749
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
5398
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
5535
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4069
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.