Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook - Using Forms (http://www.outlookbanter.com/outlook-using-forms/)
-   -   Error: Object required "dbe" Line No 25 (http://www.outlookbanter.com/outlook-using-forms/34605-error-object-required-dbe-line.html)

Lesley December 6th 06 12:00 AM

Error: Object required "dbe" Line No 25
 
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("C:Documents 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


Sue Mosher [MVP-Outlook] December 6th 06 12:58 AM

Error: Object required "dbe" Line No 25
 
Try replacing dbe with appAccess.

--
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

"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("C:Documents 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


Lacey December 6th 06 05:15 PM

Error: Object required "dbe" Line No 25
 
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.

--
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

"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("C:Documents 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



Sue Mosher [MVP-Outlook] December 6th 06 06:42 PM

Error: Object required "dbe" Line No 25
 
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

--
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 ...
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.

--
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

"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("C:Documents 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



Lacey December 6th 06 08:03 PM

Error: Object required "dbe" Line No 25
 
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

--
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 ...
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.

--
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

"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("C:Documents 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




Sue Mosher [MVP-Outlook] December 6th 06 08:16 PM

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("C:Documents 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




Lacey December 6th 06 08:28 PM

Error: Object required "dbe" Line No 25
 
ok,,,THANKS!!! I'm working on in now...

"Sue Mosher [MVP-Outlook]" wrote:

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("C:Documents 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





Lacey December 6th 06 11:35 PM

Error: Object required "dbe" Line No 25
 
Ok, this seems to be very complicated...would it be earier just to create a
table/file with the values? For example, I need a Subject List combo box
with the following values: Leave of Absence, Benefits, Internal Transfer,
Open Enrollment, etc. Then I need a corresponding Subtopic List combo box
that would show me the subtopcis under each of these categories. This same
data is stored in MS Access Database tables, but I'm not that familiar with
VBS. Any recommondations?

"Sue Mosher [MVP-Outlook]" wrote:

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("C:Documents 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





Sue Mosher [MVP-Outlook] December 7th 06 12:45 AM

Error: Object required "dbe" Line No 25
 
If the data is stored in an Access database, you must use database techniques to extract it; you can use DAO or ADO, your choice. If the data is stored in a file, you must use file access techniques to extract it; FileSystemObject is the easiest, in my opinion.

Regardless, the data isn't going to pop into the combo boxes without some coding effort on your part. I would recommend getting the data as an ADO recordset, because then it's a piece of cake to fill a combo box; see http://www.outlookcode.com/d/formcontrols.htm#listcombo

--
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 ...
Ok, this seems to be very complicated...would it be earier just to create a
table/file with the values? For example, I need a Subject List combo box
with the following values: Leave of Absence, Benefits, Internal Transfer,
Open Enrollment, etc. Then I need a corresponding Subtopic List combo box
that would show me the subtopcis under each of these categories. This same
data is stored in MS Access Database tables, but I'm not that familiar with
VBS. Any recommondations?

"Sue Mosher [MVP-Outlook]" wrote:

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.


"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("C:Documents 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






All times are GMT +1. The time now is 04:48 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com