ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   find in access database (https://www.excelbanter.com/excel-programming/286298-find-access-database.html)

douvid

find in access database
 
Hi,
I have build form in excell , and I need now to look for the informations in an access database where I can find the informations to populate the cells in the form.
Is it better to export all data from access to a workbook or to retrieve the data from access directly.
How would you proceed and do you have example (codes)

TKS
Douvid

shockley

find in access database
 
Douvid,

Not sure if this is exactly what you're looking for... Here's a DAO example
for populating a form's listbox from an Access database table.

HTH,
Shockley

Private Const dbDir As String = "I:\MyDir\"
Private db As Database, _
rs As Recordset
Sub TextEx()
frmMain.Show
Set db = OpenDatabase(dbDir & "MyDatabase")
Set rs = db.OpenRecordset("Table1")
rs.Index = "Name"

If Not rs.EOF Then
rs.MoveFirst
Do
frmMain.lbxNames.AddItem (rs!Name)
rs.MoveNext
Loop Until rs.EOF
End If
frmMain.Show
End Sub



"Douvid" wrote in message
...
Hi,
I have build form in excell , and I need now to look for the informations

in an access database where I can find the informations to populate the
cells in the form.
Is it better to export all data from access to a workbook or to retrieve

the data from access directly.
How would you proceed and do you have example (codes)

TKS
Douvid





All times are GMT +1. The time now is 01:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com