Access 2003 macro problem

I've been developing with Access '97 for quite some time. But now that we've 
moved all of our customers to Access 2003 I'm going to do all of the 
development with that tool. I have a macro which worked great in '97. The 
macro was invoked by using the keystroke combination Ctrl-E. In a macro 
named Autokeys, the Macro Name is ^e and the action is the name of a Public 
Sub in a Module. When invoked with Ctrl-E while the cursor was positioned on 
the declaration line of a new Sub or Function (either in a Module or a 
Form's Class Module, etc.) it would create a skeleton declaring certain 
variables and defining the error handler, etc., like so:

Public Function GetCouponCode(Invoice As Long) As String

    On Error GoTo Error_GetCouponCode

    Dim db As Database
    Dim strSQL As String
    Dim rs As Recordset

    Set db = DBEngine(0)(0)

Exit_GetCouponCode:
    Exit Function

Error_GetCouponCode:
    msgbox Error, vbCritical, "Error " & err & " - GetCouponCode"
    Resume Exit_GetCouponCode

End Function

When I try to invoke the macro with Ctrl-E in Access 2003, an Export File 
dialog pops up. Fine, I thought, just a conflict wiht that key combination, 
so I changed the Maro Name to ^+e, which should change the keystroke to 
Ctrl-Shift-E. Nothing happens when I type that keystroke in a module. 
Interestingly, if I am in the main Access 2003 window, that keystroke *does* 
invoke the function defined as the Action for the macro, but with disastrous 
results since I'm not in a Code Window. It seems that now that the Code 
"Window" is actually a separate process, it is ignorant of any macros 
defined in the main access window. So, how do I define a macro that works in 
the Code process? I've tried using the Help system to find out, but, 
frankly, the new Help system SUCKS (that's for another post)! 


0
Ron
6/21/2007 4:43:52 PM
access 16762 articles. 3 followers. Follow

1 Replies
1042 Views

Similar Articles

[PageSpeed] 41

On Jun 21, 9:43 am, "Ron Hinds" <b...@microsoft.com> wrote:
> I've been developing withAccess'97 for quite some time. But now that we've
> moved all of our customers toAccess2003 I'm going to do all of the
> development with that tool. I have a macro which worked great in '97. The
> macro was invoked by using the keystroke combination Ctrl-E. In a macro
> named Autokeys, the Macro Name is ^e and the action is the name of a Public
> Sub in a Module. When invoked with Ctrl-E while the cursor was positioned on
> the declaration line of a new Sub or Function (either in a Module or a
> Form's Class Module, etc.) it would create a skeleton declaring certain
> variables and defining the error handler, etc., like so:
>
> Public Function GetCouponCode(Invoice As Long) As String
>
>     On Error GoTo Error_GetCouponCode
>
>     Dim db As Database
>     Dim strSQL As String
>     Dim rs As Recordset
>
>     Set db = DBEngine(0)(0)
>
> Exit_GetCouponCode:
>     Exit Function
>
> Error_GetCouponCode:
>     msgbox Error, vbCritical, "Error " & err & " - GetCouponCode"
>     Resume Exit_GetCouponCode
>
> End Function
>
> When I try to invoke the macro with Ctrl-E inAccess2003, an Export File
> dialog pops up. Fine, I thought, just a conflict wiht that key combination,
> so I changed the Maro Name to ^+e, which should change the keystroke to
> Ctrl-Shift-E. Nothing happens when I type that keystroke in a module.
> Interestingly, if I am in the mainAccess2003 window, that keystroke *does*
> invoke the function defined as the Action for the macro, but with disastrous
> results since I'm not in a Code Window. It seems that now that the Code
> "Window" is actually a separate process, it is ignorant of any macros
> defined in the mainaccesswindow. So, how do I define a macro that works in
> the Code process? I've tried using the Help system to find out, but,
> frankly, the new Help system SUCKS (that's for another post)!

Access 97 included modules and VBA Editor as part of Access. One of
the major changes for Access2000 was that the VBA editor is a separate
program from Access and does not respond to macros in Access.
Best thing I can think of is to have your code "template" easily
available somewhere for copy-pasting to start a new procedure.
Sorry.
Dave

0
david12
6/22/2007 12:28:17 AM
Reply:

Similar Artilces:

Integration of Java application with Microsoft Outlook 2003
hi, I need to interface my Java application with Microsoft Outlook 2003. I need a set of PIs for that. Can anyobdy guide me in this context? thanx. mulayarvind <arvind.mulay@gmail.com> wrote: > I need to interface my Java application with Microsoft Outlook 2003. I > need a set of PIs for that. Can anyobdy guide me in this context? Try asking in the programming group news://msnews.microsoft.com/microsoft.public.outlook.program_vba or the interoperations group news://msnews.microsoft.com/microsoft.public.outlook.interop -- Brian Tillman ...

Outlook 2003 keeps crashing #2
I get this message when I look in System information. Outlook keeps crashing quite often. I cannot for example delete two messages without outlook crashing. My colleagues do not have this problem. We are using the Microsoft mail exhange server. Faulting application outlook.exe, version 11.0.5510.0, stamp 3f1380f0, faulting module mso.dll, version 11.0.5606.0, stamp 3f334cce, debug? 0, fault address 0x003b6e16. Does anyone has a solution?=20 Best regards/ Bj=F6rn 1) I would definitely apply Service Pack 2for Office 2003 + applicable critical security updates. 2) Have you tried starting O...

Password Issue with MS Money 2003
Hello, I am not familiar with newsgroups but I hope it is a forum to seek assistance. I am unable to reach MS support via email from my home computer on this issue. My Money 2003 requires a net passport password to open my account in Money that I have successfully accessed for approximately 12 months. It does not recognize my password now. I have attempted several times with my existing password, changed my net passport password, even uninstalled and re- installed MS Money 2003 to gain access to my account. Nothing has worked. Each time it states I have failed to enter the corr...

Exchange 2003 new install can not receive external email.
I have just setup a new Windows Server 2003 standard edition with Exchange 2003 standard edition on it. I have been working for a while trying to get it to receive external email. I can send out and send/ receive internal messages, but when someone trys to send me a message from outside our network they get the following returned mail message This Message was undeliverable due to the following reason: Each of the following recipients was rejected by a remote mail server. The reasons given by the server are included to help you determine why each recipient was rejected. Recipient: <**...

Excel not Access
I have designed an Access database that holds records relating to my stores audit results going back for about 5 years plus a load more information relating to these stores. This was used to produe a pack once a month, however a change in senior management means that I have got to shelve this and prodce a similar pack in Excel. The idea would be that the user could select a month or a 12 mnth date range that would produce data that could then be used to populate a number of excel templates that have been designed. Having not used excel for years I would be grateful for any suggestion...

multiple Domain name delivery problem
hi, I currently have Exchange Server 2003 Build 7638:2 SP2,. We have multiple domain names being delivered to the exchange store. I have nothad any problems, but i currently have one user that is not receiving emails with attachments from one certain "internet" sender to one of her email addresses, but the other address works fine & if they send emails without attachments, everything works fine from either address. I have had the user send them message with attachments to me & the user with the problem & i get the message, but not the other user! I even use message...

Exchange update problem
I have tried to upgrade exch2k3 sp1 to sp2, but the update fails with "the file pcproxy.dll is in use, and setup cannot identify the app or srvc. setup cannot continue" Any clues/ideas/suggestions? Please. -- ----------------------------------------------------------------------------------------------------------------------- This message has been checked for all known viruses. The information contained in this e-mail and any attachments is confidential and may be the subject of legal, professional or other privilege. It is intended for the named addressee only and may not ...

Outlook 2003 and "Check Names"
Hi, We are testing Outlook 2003 at our office now and there is one very frustrating "feature" that is bugging all of us. When we create a new e-mail message and type in the first name of a person from the global address book and hit ctrl- k to check the name...we get a response that Outlook doesn't recognize the name and there are "no suggestions". The only way Check Name will successfully resolve the name is if we type it last name first (ie, Gates, Bill). This was not the case in Office XP or Outlook 2000. You could search by first name (or partial first name)...

docmd.transfertext problem
Hi, I am using access 97 and tried to import a csv file to the mdb table. I run a code as following: DoCmd.TransferText acImportDelim, "Specification4", "input", DEFAULT_PATH & "online.txt", 1 In online.txt, there is a field which is 10 digit number and I specified it as a double datatype in the specification4. After the import, I found out that the 10 digit number data in the field get empty in the destined table while other fields are all right. Therefore I import manually using specification4 instead of running code. This time the 1...

SQL deadlock problem
I am currently having a big issue with sql deadlocking on the PrincipalObjectAccess table. The last few months I have been working on a synchronization process using a Biztalk orchestration. The sync uses the crm webservices to create and update account and contact records in CRM. But now deployment to the production environment gives me some problems. It seems that when trying to update account records (which is one of the first actions in the sync process) the webservice gives me Generic SQL errors and SQL timeouts. After extensive profiling and tracing in SQL I found that there are...

Input Excel 'Password to Open' through control in access form
Hi All, We know,Excel has prompt password to open it files. Is it possible to create a code that can supplies the excel prompt password?.So that when we open the excel file through our access control in a form, the excel files can be opened automatically.But when the excel files opened from its default icon,it will prompt a password first. ...

Personal Macro Workbook
I had some macro stored in the personal macro workbook but now I can not find the workbook. When I try to do a new macro and store it in the "Personal Macro Workbook" I get the error message "Personal Macro Workbook in the startup folder must stay open for recording". I click ok and get a message that I'm unable to record. I can record macro to other workbooks. What happened to the personal macro workbook ? Thanks ...

Install Exchange 2003 Server on new Hardware with same name
I got a new server to move my Exchange Server Installation. I want to keep the name I'm using now for my Server. Already read TechNet Article "How to Move Exchange Server 2003 to New Hardware and Keep the Same Server Name". Is there anything else that I should be aware of that is not on this TechNet article? I'm using a different Disk Configuration, does this matters? Should this be a smooth process? Thanks for any help you can give. The drive letters MUST match, because the paths of the databases are at the Active Directory. The disks can have different sizes than the or...

Addressing within Exchange 2003
We are running Exchange 2003 SP2. We setup an MX record for a external email(alumni.cup.edu) these mailboxes do not exist within our exchange org. But when we send email to these externals email mailboxes we are getting the following NDRs: #5.5.0 smtp;550 Mailbox unavailable. #5.4.0 Is there a way in exchange to ignore these email address so that we don't get the NDR from within our Exchange Org? On Fri, 4 Aug 2006 08:08:02 -0700, Sabo, Eric <sabo_e@cup.edu> wrote: >We are running Exchange 2003 SP2. We setup an MX record for a external >email(alumni.cup.edu...

how do i add "Software Digrams" Folder in my Visio 2003
how do i add software diags folder in visio 2003 version. Like if i go to File->New it shows folders like brainstorming, project schedule, block diagrams but in my case its missing the Software Diags folder which contains activity diags, web mock ups, use case diags etc. please let me know how to get that template. thanks. Ankur What edition of Visio are you using? Check by going to the About Microsoft Office Visio dialog from the Help menu. "Ankur" <Ankur@discussions.microsoft.com> wrote in message news:F0D10BF0-A059-4A9C-B615-B99F3916F4E5@microsoft.com... > how...

Radar chart in Access 2007 report
Can you add a Radar chart to an access 2207 report? ...

[Exchange 2003] Mail enabled public folder and sender address
I have a Windows 2003 domain with a native mode Exchange 2003 organization; there are some mail enabled public folders. When a user replies to a message in a public folder, the outgoing mail's sender address is the user's one; I want it to be the public folder's one, or at least I'd like the "reply-to" address to be set to the public folder's. How can I accomplish this? Thanks Massimo You would need to grant the user permissions to be able to Send As the public folder. By default, when you reply to a message that is in a PF, the PF is not composing the ...

Strange Access Denied Problem with Windows 7
I got a new computer about six months ago that came with Windows Vista Home Premium 64bit. Before that I had done all of my .NET development either on an XP Pro VM or my former XP Pro computer at home. Shortly after getting my new computer at home, I also got a license for VMWare to be able to test my software on multiple platforms and configurations. I had wrote an application originally in VB.NET that was a simple backup utility. It supports mutiple backup configurations. Any given copnfiguration would define a backup which would be a list of files to backup, a list of folders to ...

Outlook 2003
Hello, we have one client pc with Outlook 2003 where the following problem occurs: if a mail is replied from a user created sub folder of the inbox, the reply will not appear in sent mails, but will end up in the same sub folder, sender and recipient appear as identical. The mail goes out properly though, it's just that Outlook sets internally sender = recipient and bounces the reply back to the subfolder in which the original mail is stored. This happens on a Win 2000 machine with SP4 and all updates, the other clients use Outlook 2000 or XP and there is no such problem. There are no ru...

[b]Can I download Excel data to a MS Access database?[/b]
I've built an Excel 2002 form that I want our internal customers to access from our intranet, and use. Once completed, they will send it to us as an e-mail attachment. I'd like to be able to open it, and somehow download the data from the form into an MS Access 2002 database I've built (so that we don't have to rekey it into the database). Is this possible or even feasible? Any and all help is appreciated. Thanks. :D --------- Message sent via www.excelforums.com Hi in Access check 'File - Import External data' -- Regards Frank Kabel Frankfurt, Germany "...

Import from Eudora 6 to Outlook 2003
I am trying to import messages from Eudora 6 to Outlook 2003. I am receiving the error message "The mail folder could not be opened. If another application is using this file, please close and try again. No other applications are running Thanks for any help see article 257354 of the microsoft knowledge base on http://support.microsoft.com: "Outlook Cannot Import Eudora Messages When Eudora Mail Is Stored in a Non-Default Location" ciaos >-----Original Message----- >I am trying to import messages from Eudora 6 to Outlook 2003. I am receiving the error message ...

Excel Problem
I have a 23.8 meg excel 2000 spreadsheet set for manual calculation saved to my local hard drive. Every time I try to open it, it takes forver and sometimes never opens but I do not get any error messages, let me just tell you that I am running a P4, 1 GB memory, Office 2K with SP3, and nothing else running when I try to open it. As I said it is set for manual calculation, and it is cleared to not auto calculate when opening or closing. Any idea's as to why this is happening? -- Todd I don't know why you're having this problem but I would like to point something out for w...

SOAP Exception
Hi, In my C# code, I have defined a Map object which is sent as part of a request to a web service, here's an extract of the part of the code: - Map map = new Map(); map.item = new mapItem[4] { new mapItem(), new mapItem(), new mapItem(), new mapItem() }; ................. But when I submit the request containing the Map object, the compiler throws an error with the following message:- org.xml.sax.SAXException: No deserializer for {http://xml.apache.org/ xml-soap}...

keyboard shortcut in addin macro
How do you assign a keyboard shortcut or a custom button to run a macro which is in an addin. These macros dont appear on the macro list Thanks -- Patrick Hi have a look at the OnKey method in the VBA help -- Regards Frank Kabel Frankfurt, Germany "Patrick" <Patrick@discussions.microsoft.com> schrieb im Newsbeitrag news:FBEB937C-C3FC-47BB-8E8A-EE0BBCB14DFB@microsoft.com... > How do you assign a keyboard shortcut or a custom button to run a macro which > is in an addin. > > These macros dont appear on the macro list > > Thanks > -- > Patrick Patr...

Office 2003, Outlook (Outlook Today)...
OK, this is driving me nuts. I note that w' 2003 (and XP (2002)?) the default install sets the startup folder to the Inbox. IIRC, one of the earlier Offices installed Outlook to startup w' that "all in one view" - Outlook Today. So just as a wee test - I thought I'd try that for a while, and indeed I found it quite handy to be able to see all pertinent data on the one screen. *However* (and I'm wondering if this is the case with others), I *HAVE* to use my mouse, whenever I switch to the Inbox, or Calendar, or Tasks to get the damn focus onto a 'sujbect&...