Frank, have been watching as you developed this process over recent months.
Splitting the creating the final MDE front end are things that occur right
near the end of the process, so you look like you are nearly there.
I think you have the splitting issue solved, so that's done. It's just about
as easy to split manually anyway: just make a copy of the back end, and
delete all queries, forms, reports, and modules (using Shift+Delete so you
don't have to confirm each one), and there's the back end. For the front
end, I usually create a new (blank) database, turn off Name AutoCorrect, set
minimal references, link all tables from the back end, and then import the
queries, forms, reports, and modules from the original development db.
Before doing that, I usually compact, decompile, and compact the original
MDB, so I'm not importing any junk into the new front end. This kind of
sequence:
http://allenbrowne.com/recover.html
Once you have the new MDE front end, you want to set some properties so the
end users can't too easily get at things they should not. This kind of
thing:
Function StartupProps(bSet As Boolean)
Dim dbData As DAO.Database
Dim strDb As String
'Assumes the MDE file is in the same folder and has the same name as
this one.
strDb = DBEngine(0)(0).Name
If strDb Like "*.mdb" Then
strDb = Left$(strDb, Len(strDb) - 1) & "e"
Else
Debug.Print "NOT SET"
Exit Function
End If
'Open the database
Set dbData = OpenDatabase(strDb)
ChangeProperty dbData, "StartupShowDBWindow", dbBoolean, False
Call ChangeProperty(dbData, "AllowSpecialKeys", dbBoolean, bSet)
Call ChangeProperty(dbData, "AllowBypassKey", dbBoolean, bSet)
dbData.Close
Set dbData = Nothing
End Function
Function ChangeProperty(dbs As Database, strPropName As String, _
varPropType As Variant, varPropValue As Variant) As Integer
Dim prp As Property
Const conPropNotFoundError = 3270
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
Debug.Print strPropName & " is " & varPropValue
Change_Bye:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then 'Property not found.
Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else 'Any other error.
ChangeProperty = False
Resume Change_Bye
End If
End Function