kindly, before I crash this computer against the wall..

....does someone know why when I write this declaration:
dim idx as Index (or even DAO.Index) 

it changes into:
dim idx as index (or DAO.index) 
....and obviously it screams errors if I run the code.

References seem fine.
0
Utf
3/2/2010 1:53:01 PM
access.modulesdaovba 1670 articles. 0 followers. Follow

9 Replies
1086 Views

Similar Articles

[PageSpeed] 7

As a guess, you have defined index somewhere in your database.  I am surprised 
however that Dim idx as DAO.INDEX does not overcome the problem.

Does this happen in just one database or in any database you have?

If just one, you might try to decompile and then compile your VBA code and see 
if that helps.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

rocco wrote:
> ...does someone know why when I write this declaration:
> dim idx as Index (or even DAO.Index) 
> 
> it changes into:
> dim idx as index (or DAO.index) 
> ...and obviously it screams errors if I run the code.
> 
> References seem fine.
0
John
3/2/2010 2:33:41 PM
On Tue, 2 Mar 2010 05:53:01 -0800, rocco
<rocco@discussions.microsoft.com> wrote:

Obviously? That's not obvious to me. VBA is a case-insensitive
language so the two are identical. I see this in my own programs
occasionally and it has never caused any problems. I would highly
recommend prefixing with "DAO.", so as to disambiguate this
declaration from other libraries that may have the same.

-Tom.
Microsoft Access MVP


>...does someone know why when I write this declaration:
>dim idx as Index (or even DAO.Index) 
>
>it changes into:
>dim idx as index (or DAO.index) 
>...and obviously it screams errors if I run the code.
>
>References seem fine.
0
Tom
3/2/2010 3:00:51 PM
Oh well.. it looks like in another db created from scratch it works nicely
private idx as Index
will remain... Index!

That means there's something in the application I'm working on. I will try 
to decompile it and re-compile to see what happens.

Thanks,
rocco

"John Spencer" wrote:

> As a guess, you have defined index somewhere in your database.  I am surprised 
> however that Dim idx as DAO.INDEX does not overcome the problem.
> 
> Does this happen in just one database or in any database you have?
> 
> If just one, you might try to decompile and then compile your VBA code and see 
> if that helps.
> 
> John Spencer
> Access MVP 2002-2005, 2007-2010
> The Hilltop Institute
> University of Maryland Baltimore County
> 
> rocco wrote:
> > ...does someone know why when I write this declaration:
> > dim idx as Index (or even DAO.Index) 
> > 
> > it changes into:
> > dim idx as index (or DAO.index) 
> > ...and obviously it screams errors if I run the code.
> > 
> > References seem fine.
> .
> 
0
Utf
3/2/2010 3:34:03 PM
ok...decompiled..not working yet....grrr....

rocco

"John Spencer" wrote:

> As a guess, you have defined index somewhere in your database.  I am surprised 
> however that Dim idx as DAO.INDEX does not overcome the problem.
> 
> Does this happen in just one database or in any database you have?
> 
> If just one, you might try to decompile and then compile your VBA code and see 
> if that helps.
> 
> John Spencer
> Access MVP 2002-2005, 2007-2010
> The Hilltop Institute
> University of Maryland Baltimore County
> 
> rocco wrote:
> > ...does someone know why when I write this declaration:
> > dim idx as Index (or even DAO.Index) 
> > 
> > it changes into:
> > dim idx as index (or DAO.index) 
> > ...and obviously it screams errors if I run the code.
> > 
> > References seem fine.
> .
> 
0
Utf
3/2/2010 3:54:01 PM
I'm going nuts...update:
the word "index" is a parameter used in Ribbon callbacks. I cannot change it 
or I will screw all the ribbon customization which has taken me forever and 
now works like a charm.
Could be this?


"John Spencer" wrote:

> As a guess, you have defined index somewhere in your database.  I am surprised 
> however that Dim idx as DAO.INDEX does not overcome the problem.
> 
> Does this happen in just one database or in any database you have?
> 
> If just one, you might try to decompile and then compile your VBA code and see 
> if that helps.
> 
> John Spencer
> Access MVP 2002-2005, 2007-2010
> The Hilltop Institute
> University of Maryland Baltimore County
> 
> rocco wrote:
> > ...does someone know why when I write this declaration:
> > dim idx as Index (or even DAO.Index) 
> > 
> > it changes into:
> > dim idx as index (or DAO.index) 
> > ...and obviously it screams errors if I run the code.
> > 
> > References seem fine.
> .
> 
0
Utf
3/2/2010 3:59:02 PM
I tried, but it still screams that the object "index" doesn't exist. Nice 
that in intellisense you can see inn all his glory.

"DaveT" wrote:

> I have seen this behavior with other DAO declarations such as dao.Recordset 
> instead of DAO.Recordset, etc.  Howver, the code did run OK.
> 
> To get the VBA code to display correctly, I used Edit, Replace (Current 
> Project) to replace all dao.Recordset with DAO.Recordset.
> 
> Can't remember the circumstances, but I've seen this several times and the 
> Replace cleans it up.
> 
> -- 
> Dave Thompson
> Allen, TX
> US
> 
> 
> "rocco" wrote:
> 
> > ...does someone know why when I write this declaration:
> > dim idx as Index (or even DAO.Index) 
> > 
> > it changes into:
> > dim idx as index (or DAO.index) 
> > ...and obviously it screams errors if I run the code.
> > 
> > References seem fine.
0
Utf
3/2/2010 4:06:03 PM
Yes, it could be that is the problem.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

rocco wrote:
> I'm going nuts...update:
> the word "index" is a parameter used in Ribbon callbacks. I cannot change it 
> or I will screw all the ribbon customization which has taken me forever and 
> now works like a charm.
> Could be this?
> 
> 
> "John Spencer" wrote:
> 
>> As a guess, you have defined index somewhere in your database.  I am surprised 
>> however that Dim idx as DAO.INDEX does not overcome the problem.
>>
>> Does this happen in just one database or in any database you have?
>>
>> If just one, you might try to decompile and then compile your VBA code and see 
>> if that helps.
>>
>> John Spencer
>> Access MVP 2002-2005, 2007-2010
>> The Hilltop Institute
>> University of Maryland Baltimore County
>>
>> rocco wrote:
>>> ...does someone know why when I write this declaration:
>>> dim idx as Index (or even DAO.Index) 
>>>
>>> it changes into:
>>> dim idx as index (or DAO.index) 
>>> ...and obviously it screams errors if I run the code.
>>>
>>> References seem fine.
>> .
>>
0
John
3/2/2010 6:49:16 PM
I replied to an earlier part of this thread. I did some experimenting.
Once I had declared index, I couldn't get VBA to NOT use index even
after I had deleted the bad declaration. I had to kill the module and
open a new one.

Using reserved words as variable names is a no-no for just this
reason. If you've declared index anywhere in your code, you'll need to
change it to a non-reserved word. Once that's done, if it's still
giving you problems, you may have to create new modules and copy
everything but the bad declarations into them and then kill the old
modules.

Never use reserved words for variable names.

HTH,
RD


On Tue, 2 Mar 2010 08:06:03 -0800, rocco
<rocco@discussions.microsoft.com> wrote:

>I tried, but it still screams that the object "index" doesn't exist. Nice 
>that in intellisense you can see inn all his glory.
>
>"DaveT" wrote:
>
>> I have seen this behavior with other DAO declarations such as dao.Recordset 
>> instead of DAO.Recordset, etc.  Howver, the code did run OK.
>> 
>> To get the VBA code to display correctly, I used Edit, Replace (Current 
>> Project) to replace all dao.Recordset with DAO.Recordset.
>> 
>> Can't remember the circumstances, but I've seen this several times and the 
>> Replace cleans it up.
>> 
>> -- 
>> Dave Thompson
>> Allen, TX
>> US
>> 
>> 
>> "rocco" wrote:
>> 
>> > ...does someone know why when I write this declaration:
>> > dim idx as Index (or even DAO.Index) 
>> > 
>> > it changes into:
>> > dim idx as index (or DAO.index) 
>> > ...and obviously it screams errors if I run the code.
>> > 
>> > References seem fine.

0
RD
3/3/2010 12:19:35 AM
That's a good point. A reasonable one, but... It is not me that have used a 
reserved word to declare a variable. It is Microsoft!!! The callbacks for 
customizing the Ribbon are pre-built.

rocco

"RD" wrote:

> I replied to an earlier part of this thread. I did some experimenting.
> Once I had declared index, I couldn't get VBA to NOT use index even
> after I had deleted the bad declaration. I had to kill the module and
> open a new one.
> 
> Using reserved words as variable names is a no-no for just this
> reason. If you've declared index anywhere in your code, you'll need to
> change it to a non-reserved word. Once that's done, if it's still
> giving you problems, you may have to create new modules and copy
> everything but the bad declarations into them and then kill the old
> modules.
> 
> Never use reserved words for variable names.
> 
> HTH,
> RD
> 
> 
> On Tue, 2 Mar 2010 08:06:03 -0800, rocco
> <rocco@discussions.microsoft.com> wrote:
> 
> >I tried, but it still screams that the object "index" doesn't exist. Nice 
> >that in intellisense you can see inn all his glory.
> >
> >"DaveT" wrote:
> >
> >> I have seen this behavior with other DAO declarations such as dao.Recordset 
> >> instead of DAO.Recordset, etc.  Howver, the code did run OK.
> >> 
> >> To get the VBA code to display correctly, I used Edit, Replace (Current 
> >> Project) to replace all dao.Recordset with DAO.Recordset.
> >> 
> >> Can't remember the circumstances, but I've seen this several times and the 
> >> Replace cleans it up.
> >> 
> >> -- 
> >> Dave Thompson
> >> Allen, TX
> >> US
> >> 
> >> 
> >> "rocco" wrote:
> >> 
> >> > ...does someone know why when I write this declaration:
> >> > dim idx as Index (or even DAO.Index) 
> >> > 
> >> > it changes into:
> >> > dim idx as index (or DAO.index) 
> >> > ...and obviously it screams errors if I run the code.
> >> > 
> >> > References seem fine.
> 
> .
> 
0
Utf
3/3/2010 5:47:01 AM
Reply:

Similar Artilces:

Only kind of Publisher-related
Thanks to a fellow Guild member, I've learned that Adobe Reader v7 will automatically read email addresses and URLs as a hyperlink, even if that ..pdf was created with PrimoPDF. These addies were not created as a hyperlink prior to converting to a .pdf. For those of us who would go in and manually create a link AFTER it was a ..pdf, we can just tell people to download v7. The specs aren't too demanding either: Windows Intel� Pentium� processor Microsoft� Windows 2000 with Service Pack 2, Windows XP Professional or Home Edition, or Windows XP Tablet PC Edition 128MB...

Determining a computer's AD site
What is the most accurate way to determine what site a computer is in by examining that computer? I've read that the "HKLM\SYSTEM \CurrentControlSet\Services\Netlogon\Parameters \DynamicSiteName" and SiteName if it exists are not 100% accurate and have noticed times when it didn't seem to be. thanks - JayDee Hello JayDee, Use: nltest /dsgetsite or in a script: Set oSysInfo = CreateObject("ADSystemInfo") MsgBox oSysInfo.SiteName From: http://windowsitpro.com/article/articleid/45471/q-how-can-a-client-computer-determine-which-site-it-belongs...

For Dummies:Where do I start setting up OL on my own computer?
Where I work, we've always used Outlook for email. I think we started with the version before 2000 Pro; we're now using 2007 Pro. I have Outlook 2000 Pro at home (on XP Pro SP 3). Here's the For Dummies part - Outlook has always just been there. It's been a part of our computer set-up ever since I started using computers out here. So I have absolutely no clue how to set it up for use on my own home computer!! I have a couple of gmail accounts and two web sites with email accessed through the host's web control panel. I'm wanting to set up a system where...

exchange crash
Hello Is there any possibility to recover emails from files of crashed exchange just file from disk not backup .. Anything is possible. 5.5 DR paper: http://www.microsoft.com/exchange/techinfo/administration/55/backuprestore.asp 2000: http://support.microsoft.com/kb/326052 2003: http://www.microsoft.com/downloads/details.aspx?FamilyID=A58F49C5-1190-4FBF-AEDE-007A8F366B0E&displaylang=en On Fri, 26 Nov 2004 10:21:48 +0100, "MATT" <news@mattsoft.com.pl> wrote: >Hello >Is there any possibility to recover emails from files of crashed exchange >just file from ...

Calendar sharing on the same computer ?
I previously posted in just "Outlook" but just found this group which may be better for my problem. I am using MS Office Pro 2000. Windows XP Sp2. Have 2 gb Memory. I've been browsing the web for help and group but I'm still trying to figure out how to do this. I have one computer and 2 User Accounts set up that I would like to share the Outlook Calendar with so I don't have to go back and forth to keep both calendars updated. 1 User Account is for personal use and the other one for business. It's just me, no other person. So far, I've cre...

Outlook 2000 on Win98 Crash problem
Lately when I start up Outlook 2000 or Explorer there is a good chance a box will come up telling me the program in question performed an illegal action and will be shut down. This happens when I either start Explorer (for which I have a web page as the home page) or Outlook begins examining an e-mail with html encoding. When that happens the only option I have is to reboot and hope it doesn't happen the next time. I don't know what's causing it or what the best fix is. Does anyone have any suggestions? ...

Style Crashes
I have been following the excellent shauna Kelly's websie on styles. When I try and base my Heading 4 on Heading 3, word crashes (cpu at 50% for ages) Any thoughts? Much obliged Does this happen in a particular document only? If so, the document is probably corrupt. See http://word.mvps.org/faqs/apperrors/corruptdoc.htm. -- Stefan Blom Microsoft Word MVP "Hugo" <Hugo@discussions.microsoft.com> wrote in message news:B9E0F78E-A77A-45E8-BB44-8743AA4B150A@microsoft.com... >I have been following the excellent shauna Kelly's websie on styles....

All kinds of problems
Using P2003, [Iused to use P2000]. I print a 16 to 22 page 4-H newsletter which contains a monthly calendar(taking up one whole page) that I like to isolate and do two things with. In the past I would hit select all for the page I wanted to isolate, and then copy and paste either into a Word document, or as a separate Publisher document. With 2000 I had no difficulty doing either. With 2003, when I try to copy the calendar onto a single Publisher page, it looses all the formats...the font does not copy over nor do the colors. The calendar is filled with various text boxes and images(it is a ...

Moving to a new computer
I'm trying to move my Outlook 2003 data file (Outlook.PST) to my new computer using Outlook 2007 with Windows 7. However, when I try to open the data file and point to it in the right location, it seems to keep opening up a new file that I had already created sort of by accident when I was setting up the computer. My question is, I want to open up my old data file on my new computer, but I don't know how. The instructions are not complicated. In Outlook: File > Open > Outlook Data File... Since you already created an Outlook profile, it created a new, blank PST f...

Moving Contacts from one Computer to another
I am running Outlook 2002 on my Laptop. I am about to delete and restore my computer, and when I'm done, I want to reinstall Outlook and have all the same contacts, appointments, addresses etc.... What files/folders should I save? What is the best way to go about this? Thanks in advanced! Chaz If you are connected to an Exchange Server, you're fine as far as "mailbox data" goes, however archive data could be lost. What you should do, even if not connect to Exchange, is use the search/find and searh for all .PST files, then burn to CD, DVD or copy to LAN share. .O...

Office 2008 Setup Assistant Repeatedly Crashes
Installed Office 2008 via Remote Disc to a Macbook Air. When launching Office Apps, Office Setup Assistant opens but when I attempt to continue it crashes. Here's the error report Microsoft Error Reporting log version: 2.0 Error Signature: Exception: EXC_BAD_ACCESS Date/Time: 2008-02-16 12:00:46 -0800 Application Name: Microsoft Office Setup Assistant Application Bundle ID: com.microsoft.setupassistant Application Signature: MosA Application Version: 12.0.0.071130 Crashed Module Name: EntourageLegacy Crashed Module Version: unknown Crashed Module Offset: 0x000e921f Blame Module Name: Ent...

some kind of Conditional format?
Hi all, I've got an issue where I need a formula that when I put a date (or any value) in cell A1, the text 'Closed' is automatically entered in cell B1 - I'm sure I've seen it somewhere before (probably used it too), but I've searched in vain - can anyone help? TIA Dave Not conditional format, but in B1 you can use the formula =IF(A1="","","Closed") -- David Biddulph "Dave" <dave@nospam.com> wrote in message news:JwE7n.24409$AJ7.20557@newsfe17.ams2... > Hi all, > > I've got an iss...

Entourage Crashes Continually
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Email Client: pop I have upgraded to 1222.2.4database daemon fatal error <br><br> I had an email I could not delete which is when the trouble seemed to start. At first email would only show up partially in inbox and now it crashes when I open app. I found a similar post and rebuilding seems to have solved it. <br><br>Thank You ...

Access crashes on save/preview
I am having a problem with Access. Whenever I am in 'Design Mode' in a Report, Access crashes when I click Save or try to Preview the report. There is not an error message. I have to restart Access. What interesting is that I can go to the Query and it will run fine. Then, I go to the 'Reports' and double click my report and it will run perfectly. But when I go into Design mode from viewing the report, the program crashes if I make a change and try to save or simply hit the 'Preview' button the program crashes. What do you guys think? I really need some help here. A...

Compile VBA script to make it portable to other computers
Hi, I made a Word VBA script, which doing various operations on file and headers, footers, etc and i want to move it to other computers. How this can be done? Is there a way to compile script? "huk" <piotr.huk@gmail.com> wrote in message news:44e8e2b7-34ef-479f-8509-db99cef04571@l19g2000yqb.googlegroups.com... > Hi, > I made a Word VBA script, which doing various operations on file and > headers, footers, etc and i want to move it to other computers. How > this can be done? Is there a way to compile script? Distributing macros to other users http://...

Outlook 2007 crashing with CRM4 desktop client
Outlook 2007 crashes and I get the message below in Event Viewer after I click Synchronize Outlook with CRM. The crash is not immediate, it says Checking for Changes and there is a status bar, but 60-90 seconds later Outlook dies. I have tried rebuilding my Outlook profile, deleting the two outlook folders in documents and settings, reinstalling the crm client, reinstalling office, and reinstalling all the .net frameworks.. I also disabled Contact synchronization before clicking Synchronize, but that didn't help. I do not have any other Outlook plugins installed.. Rebuilding the ...

Outlook 2003 crashes when started HELP!!
I have been using outlook for a while with no problems. Until about a week ago I start it up and it just crashes. I can't do anything in the program before it crashes. It askes if I want to send an error report and restart the program. Anyways here is what it says.....Faulting application outlook.exe, version 11.0.5207.5, stamp 3ea0af8d, faulting module msouplug.dll, version 2004.1.4.17, stamp 4156f98d, debug? 0, fault address 0x000104ca. When I go to the office update page it says everything is up to date. I tired manully d/ling updates and won't install them cause file version ...

crash in _free_dbg_lk
I have an MFC app in VC++ V6. When I delete one of my objects, I get the following error: "DAMAGE: after Normal block (#6269) at 0x06C56BE8" This is the line of code in the method that seems to be failing: if (!CheckBytes(pbData(pHead) + pHead->nDataSize, _bNoMansLandFill, nNoMansLandSize)) _RPT3(_CRT_ERROR, "DAMAGE: after %hs block (#%d) at 0x%08X.\n", szBlockUseName[_BLOCK_TYPE(pHead->nBlockUse)], pHead->lRequest, (BYTE *) pbData(pHead)); This is the call stack: _free_dbg_lk(void...

Can't open URL links in e-mail due to restrictions in this comput
Whenever I receive mail and it has a link to a url site and I click on it, I get the following message. "This action has been cancelled due to ristrictions on this computer" How do you reset the restriction Henry wrote: > Whenever I receive mail and it has a link to a url site and I click on it, I > get the following message. > "This action has been cancelled due to ristrictions on this computer" > How do you reset the restriction Don't pretend to us that you have never heard of Google. http://www.google.com/search?q=%2Boutlook+%2Bcancelle...

RMS Client Crashes
We are running a 3 license system with the RMS application server residing on lane 1. Lane 2 is connected via a wireless LAN. The third [receiving] station is connected via an ethernet cable to the wireless router. We get frequent crashes on Lane 2, and often a blind closed batch is created and new batch is opened. (This makes the bookkeeper cranky.) The error message indicates anetwork error, but when we test the station (by opening a web browser) the connection is there. Has anyone else experienced this problem? Any suggestions? RMS is extremely sensitive to network conditions. A wirel...

Outlook 2003 Crashes after Exchange 2003 mailbox move
It looks like the problem has been around since last November. We have similar problem on one of the Exchange 2003 server with Trend Scanmail 7.0. Outlook 2003 crashes after mailbox move, follow up with a reboot. We can correct the problem by remount the mailstore but still it is very frustrating to the users. It's funny that Outlook 2000 and XP do not seem to affected by this problem. Anyone know if there is a fix for this yet? http://groups.google.com/groups?q=0x0000eddc+outlook.exe&start=0&scoring=d& Does the problem go away if you disable Scanmail? -- Ed Crowley M...

computing formula according to criteria #4
Hi, Thanks so much for your help. Unfortunately it doesn'r work. Your suggested formula for average yied 0 - so I'm sticking to the SUMPRODUCT one, and the suggested formula fo STDEV gives the wrong values (I think it has to do with adjacent cells which I don't understand....). There must be a way to do it : -- lior ----------------------------------------------------------------------- liory's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1049 View this thread: http://www.excelforum.com/showthread.php?threadid=26138 ...

Crashing after a clean install
Hi, Clean install of 2007 on a new PC, all works fine except Outlook. Have tried to use 'autodiscover' to connect to account but keeps crashing. Tried manually - keeps crashing. Event viewer has the source as "Microsoft Office 12" "Faulting application outlook.exe, version 12.0.6514.5000, stamp 4a89dc70, faulting module rpcrt4.dll, version 5.1.2600.5795, stamp 49e5f46d, debug? 0, fault address 0x0000b34f." Have tried the detect and repair. Crashes into safe mode. MSKB has not help files for this error! Can anyone help please? TIA, ...

Computer Problem when using Excel file
Hi, I have the database file located in company network, specially pivottable and pivotchart sheet, when I click on any cell instead of have one pivottable and pivotchart, the file start spreading several table and chart on top each other. and It's happend only on my computer, I try a few different computers, they are working fine. Can anyone please tell me what problem is it? How can I fix this problem? Thanks a lot. ...

Kind of OT, kind of not OT
As some of you know, I used to work for a major computer manufacturer. Well, earlier today I stopped to see some of the people I used to work with in a neighboring town. While I was there, one of the employees was going to deal with a customer issue. He had ordered Office (not sure which version) on Jan 28 and was chewing everyone's butt out stating he STILL hadn't received it. He'd called the tech support department and the local presence and bitched at everyone. After doing some double-checking, the young woman found his receipt and apparently she remembered this customer. She ...