G
GD
I thought this question was answered, but apparently not. I have a command
button on a form to open a new database, but the space between Ken & Smith in
the code below is preventing the DB from opening.
Private Sub cmdGoToPaybacks_Click()
On Error GoTo Err_cmdGoToPaybacks_Click
Dim stAppName As String
stAppName = "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE
S:\Finance\FinCommon\Ken Smith\Paybacks\Paybacks.mdb"
Call Shell(stAppName, 1)
Exit_cmdGoToPaybacks_Click:
Exit Sub
Err_cmdGoToPaybacks_Click:
MsgBox Err.Description
Resume Exit_cmdGoToPaybacks_Click
End Sub
The warning I get is "MicroSoft Office Access can't find the database file
'S:\Finance\FinCommon\Ken.mdb'
Is there a way to account for the space in code? I don't have the option of
changing the folder name.
--
GD
Access can only have one database open at a time, though you can be linked
simultaneously to many data files. You can however program a command button
to open another instance of Access to show your other database.
You can use the command button wizard to generate code similar to below:
Private Sub btnOtherDB_Click()
On Error GoTo Err_btnOtherDB_Click
Dim stAppName As String
stAppName = "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE
FullPathName\MyApp.mdb"
Call Shell(stAppName, 1)
Exit_btnOtherDB_Click:
Exit Sub
Err_btnOtherDB_Click:
MsgBox Err.Description
Resume Exit_btnOtherDB_Click
End Sub
-Ed
button on a form to open a new database, but the space between Ken & Smith in
the code below is preventing the DB from opening.
Private Sub cmdGoToPaybacks_Click()
On Error GoTo Err_cmdGoToPaybacks_Click
Dim stAppName As String
stAppName = "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE
S:\Finance\FinCommon\Ken Smith\Paybacks\Paybacks.mdb"
Call Shell(stAppName, 1)
Exit_cmdGoToPaybacks_Click:
Exit Sub
Err_cmdGoToPaybacks_Click:
MsgBox Err.Description
Resume Exit_cmdGoToPaybacks_Click
End Sub
The warning I get is "MicroSoft Office Access can't find the database file
'S:\Finance\FinCommon\Ken.mdb'
Is there a way to account for the space in code? I don't have the option of
changing the folder name.
--
GD
Access can only have one database open at a time, though you can be linked
simultaneously to many data files. You can however program a command button
to open another instance of Access to show your other database.
You can use the command button wizard to generate code similar to below:
Private Sub btnOtherDB_Click()
On Error GoTo Err_btnOtherDB_Click
Dim stAppName As String
stAppName = "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE
FullPathName\MyApp.mdb"
Call Shell(stAppName, 1)
Exit_btnOtherDB_Click:
Exit Sub
Err_btnOtherDB_Click:
MsgBox Err.Description
Resume Exit_btnOtherDB_Click
End Sub
-Ed