find in access database

D

Douvid

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
 
S

shockley

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 said:
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.
 
Top