Hi.
I'd like to add a button on a secure form in my .MDB file to make an .MDE
file from the calling .MDB file. I can't find any VB command for this.
You won't find any code suggestions either, because one cannot make an MDE
file via code or macro from the currently open database file. However, one
can close the current database file, then open another one that has a form
with a command button that calls the following sub to create a new MDE file
from the MDB file just closed:
' * * * * Start Code * * * *
Private Sub createMDE()
On Error GoTo ErrHandler
Dim accApp As New Access.Application
accApp.SysCmd 603, "C:\Work\MyDB.mdb", "C:\Work\MyDB.mde"
CleanUp:
accApp.Quit
Set accApp = Nothing
Exit Sub
ErrHandler:
MsgBox "Error in createMDE( )" & vbCrLf & _
"in Utils module." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & vbCrLf & Err.Description
Err.Clear
GoTo CleanUp
End Sub ' createMDE( )
' * * * * End Code * * * *
Please note that this SysCmd is undocumented and unsupported by Microsoft.
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that the first and
best answers are often given to those who have a history of rewarding the
contributors who have taken the time to answer questions correctly.