How do I prevent a run-time application from being opened in full retail Microsoft Access?
You’ll need to create a function that uses SysCmd() to check to see whether the database is currently opened under the run-time version: Function KillIt() As Integer If Syscmd(SYSCMD_RUNTIME) = 0 Then ‘ use the following intrinsic constant for Microsoft Access 95 or 97 ‘ If Syscmd(acSysCmdRuntime) = 0 Then Application.Quit End If End Function Call this function from your Startup form or AutoExec macro as the very first action. This is the first line of defense. Unfortunately, anyone who knows to hold down the SHIFTkey will not be kept out by this function, so you will also want to disable holding down the shift key, as shown in the previous section. You may also want to put additional calls to KillIt() in your database-for example, in the Open events of your forms, or as calculated columns in queries. You may not be able to keep people out, but you can certainly make it inconvenient for them to be in. Microsoft Access 95, Microsoft Access 97, and Microsoft Access 2000: You can set the