Welcome to Dream.In.Code
Become a VB Expert!

Join 137,271 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,434 people online right now. Registration is fast and FREE... Join Now!




Visdata Aceess MDB into Listbox

 
Reply to this topicStart new topic

Visdata Aceess MDB into Listbox

devonknows
30 Nov, 2006 - 05:12 AM
Post #1

New D.I.C Head
*

Joined: 30 Nov, 2006
Posts: 5


My Contributions
Hi, i was wondering if anyone could help me, i have 3 fields in my Access database that i created with the Add-In, Visdata.
The Field names are ID (Auto Incr), Name and Directory.
what i want is to access the data that is in the name field and place it all into a listbox, but ive tried using the data control and i can only figure out how to put that into text box, if anyone can help me put it into a listbox i would be most grateful, thank you
User is offlineProfile CardPM
+Quote Post

tody4me
RE: Visdata Aceess MDB Into Listbox
30 Nov, 2006 - 12:24 PM
Post #2

Only Jenny Craig makes thin clients...
Group Icon

Joined: 12 Apr, 2006
Posts: 1,279



Thanked: 3 times
Dream Kudos: 100
My Contributions
if using .net, you can use the datagrid control. There really isn't a good way to do it with VBA or using VB6. You could also set databindings in .net for a list box and set up columns, then bind them to a column in a table in access, but by that time you might as well just use the data grid control. Really easy to set up in .net. Lots of coding to do in VBA or VB6 though.
User is offlineProfile CardPM
+Quote Post

KeyWiz
RE: Visdata Aceess MDB Into Listbox
1 Dec, 2006 - 01:15 AM
Post #3

D.I.C Regular
Group Icon

Joined: 26 Oct, 2006
Posts: 428


Dream Kudos: 125
My Contributions
If you are able to get the info to a text box, add it to a listbox like this
CODE

List1.AddItem Text1.Text


If you post your code up to now it would help us see what you are doing.
User is offlineProfile CardPM
+Quote Post

GaryOCo
RE: Visdata Aceess MDB Into Listbox
23 Mar, 2007 - 04:10 PM
Post #4

New D.I.C Head
*

Joined: 23 Mar, 2007
Posts: 2


My Contributions
This is an easy way to achieve what you want to do in VB6.

1. Add a Data Control to your form.
2. Add this code to your form.

Data1.DatabaseName="Enter your database's path and name here"
Data1.DataSource="SELECT Name FROM <Name of the table here>" 'Do not include the brackets<> in the table name
Data1.Refresh
If Data1.Recordset.Recordcount>0 Then 'Just make sure there is some data here
With Data1.Recordset
.MoveFirst
While Not .EOF=True
List1.AddItem !Name
.MoveNext
Wend
End With
End If

This post has been edited by GaryOCo: 23 Mar, 2007 - 04:18 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 07:52PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month