I am beginner in Access programming. I have two queries:
1. I have two list boxes and one is populated with names of fields from a table within the access database. I would like to click on the first listbox (lstFields) and the values of the records in that field are added to the second list box (lstValues). This works fine in Access 2002 but not in Access 2000. I guess this is because the libraries are different. I am using a separate Funclion 'Additem' too because the listbox does not support additem method in access 2000. I tried to 'cheat it' and loaded Microsoft DAO 3.6 Object library but did not work, Access crashed instead. Any workaround?
Private Sub lstFields_Click()
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("Incidents")
While Not rst.EOF
str = rst.Fields(lstFields.Value).Value
AddItem lstValues, str
rst.MoveNext
Wend
End Sub
2. I am running ArcMap ActiveX inside Access and would like to Access a table within the database and use to prepare a layer. I have done this by referencing the database from file using an ArcObjects code but this brings a complication in that Access sees that the db is being opened twice and the locking causes problems. Is it possible to access the table from within and have it accepted as an arcmap object supporting IFeatureWorkspace interface or just opent the table (recordset?) and pass it as an arcmap object supporting IDataset interface? Since both Access abd ESRI geodatabase use .mdb, I thought it would wok better. Please help.
Kind regards
************************
J. G. Nasser Olwero
Mpala Research Centre
P. O. Box 555, Nanyuki 10400, KENYA
Phone: +254 (0) 62-32758/1
Fax: +254 (0) 62-32750
Website: www.mpala.org
1. I have two list boxes and one is populated with names of fields from a table within the access database. I would like to click on the first listbox (lstFields) and the values of the records in that field are added to the second list box (lstValues). This works fine in Access 2002 but not in Access 2000. I guess this is because the libraries are different. I am using a separate Funclion 'Additem' too because the listbox does not support additem method in access 2000. I tried to 'cheat it' and loaded Microsoft DAO 3.6 Object library but did not work, Access crashed instead. Any workaround?
Private Sub lstFields_Click()
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("Incidents")
While Not rst.EOF
str = rst.Fields(lstFields.Value).Value
AddItem lstValues, str
rst.MoveNext
Wend
End Sub
2. I am running ArcMap ActiveX inside Access and would like to Access a table within the database and use to prepare a layer. I have done this by referencing the database from file using an ArcObjects code but this brings a complication in that Access sees that the db is being opened twice and the locking causes problems. Is it possible to access the table from within and have it accepted as an arcmap object supporting IFeatureWorkspace interface or just opent the table (recordset?) and pass it as an arcmap object supporting IDataset interface? Since both Access abd ESRI geodatabase use .mdb, I thought it would wok better. Please help.
Kind regards
************************
J. G. Nasser Olwero
Mpala Research Centre
P. O. Box 555, Nanyuki 10400, KENYA
Phone: +254 (0) 62-32758/1
Fax: +254 (0) 62-32750
Website: www.mpala.org