sunilvedula Posted May 15, 2009 Report Share Posted May 15, 2009 HI all, i want to trigger macro express when a key is pressed in ms-access database. i have developed a database in ms- access which multiple users use. Now when they complete a work they need to send an email to business are confirming the job is done with a formatted excel sheet to which a reply is sought from the business area who will attach some images and send it back to us. With access i am able to send mail but cannot format the excel sheet the way i want. i have designed a macro to do the desing part so that it goes to the mail and pastes the data in exce in rich text format so that the business are people can drop images beside the data and send it back to us. to make this possible i should be able to trigger the macro express but that i find it difficult. i can try opening the macro file with sql code but how do i make it trigger? can macro express self trigger once the file is opened? any ideas please put forward as i need to submit my presentation ASAP. BTW I USE MACRO EXPRESS 3.2 Quote Link to comment Share on other sites More sharing options...
paul Posted May 15, 2009 Report Share Posted May 15, 2009 You need to write an Access macro using RunCode to call a VBA public function which you must write. This macro can be triggered via a hotkey, e.g. Ctrl-M, by setting up an Autokeys macro. Your VBA function will do one of 2 things: - use the Shell command to call MeProc passing in the name of your macro (plus any parameters you may want to use via the Variables Restore command) - use the VBA code published here: Using PostMessage (but I haven't found a way of passing parameters using this method) Quote Link to comment Share on other sites More sharing options...
sunilvedula Posted May 19, 2009 Author Report Share Posted May 19, 2009 thank you for your response. should work for me too. will try and let you know Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.