Outlook Crashes: MS09.DLL

F

felton

I have the following code, originally from Helen Fedema, to populate a combo
box on an Outlook form using data from an Access database.

It works to a point where it displays the data I want, but when I make a
selection from the list it displays, Outlook crashes with an exception fault
in MS09.DLL

Dim rst
Dim dao
Dim wks
Dim db
Dim nms
Dim fld
Dim itms
Dim itm
Dim strAccessDir
Dim objAccess
Dim StaffArray(200, 7)

Function Item_Open()
FillComboBox()
End Function

Function FillComboBox()
Set objAccess = Item.Application.CreateObject("Access.Application")
strDBName = "C:\ABCPartners\ABC_DATA_2K.MDB"
objAccess.Quit

Set dao = Application.CreateObject("DAO.DBEngine.36")
Set wks = dao.Workspaces(0)
Set db = wks.OpenDatabase(strDBName)

Set rst = db.OpenRecordset("tblStaff")
Set ctl =
Item.GetInspector.ModifiedFormPages("TimeTrak").Controls("cboStaffName")
ctl.ColumnCount = 7
ctl.ColumnWidths = "0; 0 pt; 0 pt; 0 pt; 200 pt; 0 pt; 50 pt"
StaffArray(200, 7) = rst.GetRows(100)
ctl.Column() = StaffArray(200, 7)
End Function

Sub cmdFillComboBox_Click
FillComboBox()
End Sub


I would like to be able to select data from the combo and have it display in
the field. I also need to use data from other columns in the combo to display
as read only on the form.

As an aside, after these two problems are solved, I need to post/export the
data back to Access: the first problems are in the preceding paragraph.

Any ideas would be appreciated, with thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top