473,320 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How can i put thevalue in combobox direct from MSAccess?

daffurankan
hai,
iam ankan
i am facing a problem my problem is
i wanted that in visual basic 6.o i haddesign a form and ther is a combobox in it and i wanted that when i run the application the items in combobox1
should pick directly from the database which is Designed in MS Access
urgent reply me a soon
orASAP.


act soon urgent reply me .
Aug 15 '07 #1
1 987
fplesco
82
hai,
iam ankan
i am facing a problem my problem is
i wanted that in visual basic 6.o i haddesign a form and ther is a combobox in it and i wanted that when i run the application the items in combobox1
should pick directly from the database which is Designed in MS Access
urgent reply me a soon
orASAP.


act soon urgent reply me .
Hey -

Expand|Select|Wrap|Line Numbers
  1. Dim Con As Connection
  2. Dim Rs As Recordset
  3.  
  4. Public Sub PopulateCombobox()
  5. Set Con = New Connection
  6.     Con.Open ""              'Connectionstring here
  7.     Set Rs = New Recordset
  8.     Rs.ActiveConnection = Con
  9.     Rs.Open "Select * from EmpTable", Con, adOpenKeyset, adLockOptimistic
  10.     If Rs.EOF Then
  11.         Do Until Rs.EOF
  12.              combo1.addItem Rs!<fieldname>
  13.         Loop
  14.     End If
  15. End Sub
  16.  
Aug 16 '07 #2

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

Similar topics

0
by: Rob Kennedy | last post by:
I am using a form with 2 linked combo boxes to query results on a sub-form. With my extreme lack of Access programming skills and the wealth of information on this forum I have been able to...
2
by: jaYPee | last post by:
i have search a lot of newsgroup and some website to find a sample for multi column combobox in datagrid but no luck. there are so many sample i found but it is not located in datagrid. i would...
19
by: Bernie Yaeger | last post by:
Everyone misses the point on this - what we need is a combobox autocomplete that is a dropdownlist only. When in dropdown mode, you can enter text - making that autocomplete is trivial. But when...
30
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
10
by: AA Arens | last post by:
I have two tables, one consists of company info like name and phone number. Another table where I have to fill in the contact persons. Part of the form is to choose the company he works for (From...
1
by: johnb41 | last post by:
I have some data in a hashtable, and i need to bind it to a combobox. I know it's impossible to bind a hashtable to a combobox. I need to "bind" it so the combobox gets a DISPLAYMEMBER and a...
19
by: active | last post by:
I'm using a ComboBox to display objects of a class I've defined, say CQQ. Works great except somehow I occasionally set an Item to a String object instead of an object of type CQQ. It looks...
1
by: venkatraotammineiii | last post by:
Dear all, I am working C#.net2005.I Have problem that is i have one datetimepicker and combobox.now i have msaccess databse.in that database i have datatime field.but i need to get datetime into...
1
by: Man4ish | last post by:
Hi, How Eventlistner can be used with rendred combo box. I got one example of combobox in table as follows . /* * Copyright (c) 1995 - 2008 Sun Microsystems, Inc. All rights reserved. * ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.