Hi again. I have another problem that I hope someone can help me with. I am using the shell function to open database B from a form in database A. The reason I am using the shell function is because the databases I put together will be used in Acccess Runtime instead of regular Access so the create object option is not available. Here is the code I am using for the shell function within a module of database A:
Function OpenRemoteForm(strDbFile As String)
Dim ShellInt As Integer
ShellInt = Shell("MSACCESS.EXE " & strDbFile, vbNormalFocus)
End Function
The click event that fires the shell function from the form in database A is:
Private Sub bScreening_Click()
On Error GoTo Err_Form_Open
OpenRemoteForm "C:\Users\New Beginnings\Desktop\Louise Drafts\PreScreening.accdb"
DoCmd.Close acForm, "frmForms", acSaveNo
Exit_Form_Open:
Exit Sub
Err_Form_Open:
MsgBox Err.Number & " - " & Err.Description
Resume Exit_Form_Open
End Sub
The problem I am having has to do with the spaces in the path for database B. The sub in the click event calls the shell function and passes the path to a string variable. I have tried putting single quotes and double quotes in a number of different places but am still having problems. Does anyone know exactly how the string needs to be formated to be passed correctly?
Thanks in advance
Function OpenRemoteForm(strDbFile As String)
Dim ShellInt As Integer
ShellInt = Shell("MSACCESS.EXE " & strDbFile, vbNormalFocus)
End Function
The click event that fires the shell function from the form in database A is:
Private Sub bScreening_Click()
On Error GoTo Err_Form_Open
OpenRemoteForm "C:\Users\New Beginnings\Desktop\Louise Drafts\PreScreening.accdb"
DoCmd.Close acForm, "frmForms", acSaveNo
Exit_Form_Open:
Exit Sub
Err_Form_Open:
MsgBox Err.Number & " - " & Err.Description
Resume Exit_Form_Open
End Sub
The problem I am having has to do with the spaces in the path for database B. The sub in the click event calls the shell function and passes the path to a string variable. I have tried putting single quotes and double quotes in a number of different places but am still having problems. Does anyone know exactly how the string needs to be formated to be passed correctly?
Thanks in advance