Hello everyone..im having problem in connecting my Combo Box to my database.
What i want to do is to place all entries of one column in my Db to combo box.
Like this...I want to place all entries in the Column <customer_name> of my <customer> table of my DB in my combo box. i really need this code badly.
Thanks in advance....
6 5857
Hi,
Use DBCombo or DBListBox, Set the following properties:
DataSource, DataField, RowSource, RowMember
Regards
Veena
Hi,
Use DBCombo or DBListBox, Set the following properties:
DataSource, DataField, RowSource, RowMember
Regards
Veena
there is a MsgBox saying "no compatible data source was found for this control" when i cliked the rowSource property of DBCombo...im using MySQL as my database
Try this piece of sample code. -
CboName.Clear
-
SQLName = "SELECT NAME FROM ENGINEER"
-
Rs.Open SQLName, Con, adOpenDynamic, adLockOptimistic
-
-
Set CboName.DataSource = Rs
-
For i = 0 To Rs.RecordCount - 1
-
CboName.AddItem Rs(0)
-
Rs.MoveNext
-
Next i
-
Rs.Close
-
Hope that solves your problem.
Try this piece of sample code. -
CboName.Clear
-
SQLName = "SELECT NAME FROM ENGINEER"
-
Rs.Open SQLName, Con, adOpenDynamic, adLockOptimistic
-
-
Set CboName.DataSource = Rs
-
For i = 0 To Rs.RecordCount - 1
-
CboName.AddItem Rs(0)
-
Rs.MoveNext
-
Next i
-
Rs.Close
-
Hope that solves your problem.
there is an error in the line : Set CboName.DataSource = Rs
error : ' cant bind the data source
Hi,
Add a ADODC datacontrol to your Form, and set these Properties:
Right Click ADODC1 and goto ADODC properties:
"Use Connection String" and Build.. Test the Connection.
Goto Record Source and Type the Select statement , say
Select FldName From TableName
and say OK.
Now Go to properties of DBCombo, and RowSource = ADODC1
ListField = FldName
And Run the form, it should work..
Regards
Veena
Hi,
Add a ADODC datacontrol to your Form, and set these Properties:
Right Click ADODC1 and goto ADODC properties:
"Use Connection String" and Build.. Test the Connection.
Goto Record Source and Type the Select statement , say
Select FldName From TableName
and say OK.
Now Go to properties of DBCombo, and RowSource = ADODC1
ListField = FldName
And Run the form, it should work..
Regards
Veena
thanks...
i did try this code and it worked as well..
Private Sub fillList()
Do While Not rsBot.EOF
cmboBotNo.AddItem rsBot(0) ' rsbot is a recordset
rsBot.movenext
Loop
End Sub
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Bobbak |
last post by:
Hello All,
I was wondering if it is at all possible to have a single combo box
update multiple fields in a single record. For example I have created
an Employee Info form, and in that form there's...
|
by: Bobbak |
last post by:
Hello All,
I am having trouble with this forum I am developing in Access; I have
two combo boxes, one containing the Director info, and the other
containing the Manager info. Now what I want to...
|
by: Jim Stacey |
last post by:
In my form based on the table Customers i have a combo box looking up
for the employees. The tables Employees and Customers are related in
one to many relationship, the primary key Employeeid in...
|
by: J. Thompson |
last post by:
I have an Access application linked to a SQL Server 2000 database
using ODBC. Call this database/server pair DB1
Part of the app needs to link to another local 2000 server to get data
from...
|
by: Jacques |
last post by:
Hi ,
I've 24 Combo Box in a Group , connected to the same DataSource
(ArrayList) : easy way to fill Combo .
The pb i've , is that when i select an item in 1 combo then all other
23 will...
|
by: Dave |
last post by:
I wasn't sure how to search for previous posts about this, it felt
real specific. Ok so here's the database & problem:
I have 4 combo boxes: cboServer, cboPolicy, cboDB, and
cboApplication. ...
|
by: vikas1111 |
last post by:
I have connected combo box to database and the first content of the column is displayed.. I want to display all the contents of the column in combo box .. How can i do that ?
|
by: prokopis |
last post by:
am using c# for windows application and i need some help.
i have a combo box that is connected with the database and retreive the data from a table in the database.this tha i need is if is possible...
|
by: premMS143 |
last post by:
Hi Everybody,
I'm using VB to create a stand alone application.
I want to delete some data item from Combo box & List Box.
I've done this.
When I try to delete any data item from the combo or...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
| |