Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Old 02-02-2003, 08:23 PM   #1
bauer
Newly Registered User
 
Join Date: Aug 2001
Location: Passaic, NJ
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
bauer
Send a message via AIM to bauer Send a message via Yahoo to bauer
Question Scripting.Dictionary

Hi there,

I'm having a bit of trouble. I am trying to use the dictionary object, however, when I run my code, I get an error of the object required on the red line below.

Here is my code, though nothing amazing
Code:
Dim dCat As Object
Set dCat = CreateObject(Scripting.Dictionary)
I've lloked around a bit, but couldn't seem to find anything. VBA help only has a few topics on the object itself. Although, it could be something with the fact that it's an ActiveX object (which I don't know too much about).

Any and all help would be appreciated.

Thank you!

bauer is offline   Reply With Quote
Old 02-02-2003, 09:15 PM   #2
Jon K
Registered User
 
Join Date: May 2002
Posts: 2,209
Thanks: 0
Thanked 34 Times in 15 Posts
Jon K will become famous soon enough
Set dCat = CreateObject("Scripting.Dictionary")
__________________
Access 2003, WinXP
Jon K is offline   Reply With Quote
Old 02-03-2003, 04:36 AM   #3
bauer
Newly Registered User
 
Join Date: Aug 2001
Location: Passaic, NJ
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
bauer
Send a message via AIM to bauer Send a message via Yahoo to bauer
Thank you, I should've seen that one.

bauer is offline   Reply With Quote
Old 02-05-2003, 07:33 AM   #4
chewy
SuperNintendo Chalmers
 
chewy's Avatar
 
Join Date: Mar 2002
Posts: 581
Thanks: 0
Thanked 0 Times in 0 Posts
chewy
whats a scripting dict?
chewy is offline   Reply With Quote
Old 02-05-2003, 07:38 AM   #5
bauer
Newly Registered User
 
Join Date: Aug 2001
Location: Passaic, NJ
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
bauer
Send a message via AIM to bauer Send a message via Yahoo to bauer
It's an object that takes a key/value pair I think it's like a hash
ex:
Code:
Dim dict
Set dic = CreatObject("Scripting.Dictionary")
dic.addItem "banana", "yellow"
dic.addItem "orange", "orange"
dic.addItem "apple", "red"
dic.addItem "grape", "green"
Then you could refernce the dictionary object with the fruit name and get the color.

Or you can look up in VBA help

bauer is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump




All times are GMT -8. The time now is 09:28 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World