Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making a MDE file 1

Status
Not open for further replies.

pbrown77

Technical User
Feb 21, 2005
55
US
Since we have split the DB to a BE and FE, we now make the FE that is copied onto the individual PCs a MDE.

The thing is that I am attempting to automate this and perhaps it is not possible.

When finished updating the FE mdb file, is there code or a macro, or anything that I could write that would automatically turn the mdb into a mde file in a certain location on the server? (It would overwrite the existing mde file and be ready for the batch file to download when someone opens the fe on their PC)

Once again, perhaps I am trying to automate this too much. But making the mde file is the only step holding me back from being able to hand this job off to someone else.
Everything else is push button and fill in the blank.
 
Something like this ?
DoCmd.RunCommand acCmdMakeMDEFile

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Just tried and this appears:

Run-time erro '7807':

you can't make the open database into an MDE file while running a macro or visual basic code

Any other ideas or versions?

Do I need to open a separate database that would have this code only? That way the file I want to make an MDE is not open, however how would I identify the database I want to turn into a mde?
 
FYI...

Found it....
I had to create a small database that does nothing but make mde files. A button on the main dB says to make mde file, which closes the file and opens the mdes.mdb file. When it opens there is a screen which asks the user which database they are working on. When the database is selected, the following code runs which makes the mde file, sends the "update" e-mail to all users, closes the mdes.mdb file and finally opens the updaters mde file on their computer so they can run their individual reports.

Dim a As Access.Application
Set a = New Access.Application
a.SysCmd 603, "I:\Access\Weekly\Updates\Attendance.mdb", "I:\Access\Weekly\Attendance.mde"
Set a = Nothing
DoCmd.SendObject acSendNoObject, , , "'dis users'", , , "Weekly attendance database", "The weekly attendance database has been updated for the prior week", False
MsgBox "E-mail sent to all attendance database users notifing them of update", vbInformation, "Notification Sent"
MsgBox "Your Weekly attenance database will now open to allow you to run reports", vbInformation, "Attenandance Database Now Opening"
Call Shell("""C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE"" ""G:\Weekly_Updater.mdb""", 1)
DoCmd.Quit
End Sub
 
hey pbrown77, THANKS for the info...but I have one question: How do you code the first part where you close the main mdb file and then open the mdes.mdb file? I've got the "create mdb" part working, but can't figure out how to do close db, then open different db part.
Thanks in advance! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top