View Single Post
  #6  
Old December 6th 06, 08:16 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Error: Object required "dbe" Line No 25

That was quite clear, but I think you missed my point: The code giving you problems is the part that refers to your Access database. It involves no Outlook programming issues at all. The part that has the problems is all DAO code. I just grabbed the first relevant DAO.DBEngine example I saw. . It should work the same regardless of whether you write the code in Access VBA, Outlook VBA or Excel VBA. Feel free to Google for other examples.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Lacey" wrote in message ...
Sorry,,,I thought I made it clear that I was creating an Outlook template
where I wanted to import data from MS Access into the template combo dropdown
boxes. The link you provide references EXCEL and not OUTLOOK. Is this code
good for both???

"Sue Mosher [MVP-Outlook]" wrote:

That just goes to show why you ought to ask Access code questions in an Access forum. I finally recalled that Workspace is a DAO object. You need to instantiate dbe as a DAO.DBEngine object; see http://support.microsoft.com/kb/152400

"Lacey" wrote in message ...
NOPE,,,didn't like that!!! Now, I have a script error that reads: "object
doesn't support this property or method: "appAccess.Workspaces"."

"Sue Mosher [MVP-Outlook]" wrote:

Try replacing dbe with appAccess.



"Lesley" wrote in message ...
Hi All!

I'm creating an Outlook 2003 template where I'm attempting to use combo
dropdown boxes, which import data from tables in MS Access. When I run the
template I get an "Object required "dbe" Line No. 25" error. What is this???
As of now, I was just working on the one combo box - cboSubject until I
could get that working; however, the form has four other combo boxes. Can I
merely duplicate the code once I get the first stage running? Here's the VB
script that I'm using...


Dim rst
Dim dao
Dim wks
Dim dbs
Dim nms
Dim fld
Dim itms
Dim itm
Dim strOfficePath
Dim appAccess
Dim SubjectArray(99, 2)

Function Item_Open()

FillComboBox()

End Function

Function FillComboBox()

Set appAccess = Item.Application.CreateObject("Access.Application" )
strOfficePath = appAccess.SysCmd(9)
strVersion = Item.Application.Version
strDBName = strOfficePath & "Contact Management Database_TEST.MDB"
Set wks = dbe.Workspaces(0)
Set dbs = wks.OpenDatabase("Cocuments and Settings\cisse\Desktop\Contact
Management Database_TEST.MDB")
appAccess.Quit

'Retrieve Category info from table
Set rst = dbs.OpenRecordset("tblSubtopicList")
Set ctl =
Item.GetInspector.ModifiedFormPages("Message").Con trols("cboSubject")

ctl.ColumnCount = 3
ctl.ColumnWidths = "0; 0; 75 pt"

'Assign Access data to an array of 3 columns and 100 rows
SubjectArray(99, 2) = rst.GetRows(100)

ctl.Column() = SubjectArray(99, 2)

End Function


Sub cmdFillComboBox_Click

FillComboBox()

End Sub



Ads