Code Examples

Make MDE File


This example is from Microsoft Technet Question PSS ID Number: Q202039. Although the article talks about Access 2000, I have got it to work in Access 97.

This can only be used to make an MDE for another file not the file that the code is being run from.

'***************** Code Start *******************
SendKeys information
' Code from Microsoft Technet

Function GenerateMDEFile(MyPath As String)
  Dim NAcc As Access.Application

  Set NAcc = CreateObject("Access.Application")
  'The following lines simulate accepting the default
  'name, clicking Make MDE, and clicking Save
  SendKeys MyPath & "{Enter}{Enter}"
  SendKeys "{Enter}"
  NAcc.DoCmd.RunCommand acCmdMakeMDEFile
  Set NAcc = Nothing

End Function

'****************** Code End ********************

© 1998 - 2011 Terry Wickenden TKW Design Site developed maintained and hosted by TKW Design. This site is best viewed at 1024 x 768. Optimised for Firefox.