Does anyone know how to make a command button on a form open up another MS Access database. I know this is so easy but I can't figure out how to do it.
Does anyone know how to make a command button on a form open up another MS Access database. I know this is so easy but I can't figure out how to do it.
Create a new module with this code. Option Compare Database
Option Explicit
Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation _
As String, ByVal lpFile As String, ByVal lpParameters _
As String, ByVal lpDirectory As String, ByVal nShowCmd _
As Long) As Long
Global Const SW_SHOWNORMAL = 1
Save it as "Shell_Execute".
Add the following function to your form.
Function Open_Document(DocName As String)
On Error GoTo Open_Document_Error