can someone help with this code?

G

Guest

Dim sCommand As String, lTaskID As Long
sCommand = """" & SysCmd(acSysCmdAccessDir) & "msaccess.exe """ _
& CurrentDb.Name &
""c\finalproject\sjacadets.mdb"/wrkgrp:c:\finalproject\system.mdw""" &
SysCmd(acSysCmdGetWorkgroupFile) _
& """" ' and add any other switches you require here
lTaskID = Shell(sCommand, vbMaximizedFocus)
If lTaskID <> 0 Then AppActivate lTaskID
DoCmd.Quit

is this right
 
D

Douglas J. Steele

No. If nothing else, you need some spaces in there. (between msaccess.exe
and the database name and between the database name and the /wrkgrp flag)

You also seem to have two different database names (CurrentDb.Name and
c\finalproject\sjacadets.mdb) and two different workgroup names
(c:\finalproject\system.mdw and SysCmd(acSysCmdGetWorkgroupFile))

My advice would be to check what sCommand actually contains, and see whether
it makes sense to you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top