PC Review


Reply
Thread Tools Rate Thread

Change User/Logging off

 
 
=?Utf-8?B?cmhhbm4=?=
Guest
Posts: n/a
 
      24th Feb 2006
I want to close a database and reopen it with certain command line options
("C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"
"c:\finalproject\sjacadets.mdb" /wrkgrp c:\finalproject\system.mdw) it has to
be able to be run from a button, can anyone help?

and I haved also got this bit of code can anyone help me stick the two
together

Dim sCommand as String, lTaskID as long
sCommand = """" & SysCmd(acSysCmdAccessDir) & "msaccess.exe """ _
& CurrentDb.Name & """ /wrkgrp:""" & SysCmd(acSysCmdGetWorkgroupFile) _
& """" ' and add any other switches you require here
lTaskID = Shell(sCommand, vbMaximizedFocus)
If lTaskID <> 0 Then AppActivate lTaskID
DoCmd.Quit

 
Reply With Quote
 
 
 
 
Joan Wild
Guest
Posts: n/a
 
      25th Feb 2006
You can't do it within the same Access session. So you can shell out to
open another session.

See http://www.access.qbuilt.com/html/custom_login.html
for an example to open another database.


--
Joan Wild
Microsoft Access MVP

rhann wrote:
> I want to close a database and reopen it with certain command line
> options ("C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"
> "c:\finalproject\sjacadets.mdb" /wrkgrp c:\finalproject\system.mdw)
> it has to be able to be run from a button, can anyone help?
>
> and I haved also got this bit of code can anyone help me stick the two
> together
>
> Dim sCommand as String, lTaskID as long
> sCommand = """" & SysCmd(acSysCmdAccessDir) & "msaccess.exe """ _
> & CurrentDb.Name & """ /wrkgrp:""" &
> SysCmd(acSysCmdGetWorkgroupFile) _ & """" ' and add any other
> switches you require here
> lTaskID = Shell(sCommand, vbMaximizedFocus)
> If lTaskID <> 0 Then AppActivate lTaskID
> DoCmd.Quit



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Logging In Without Logging User Out =?Utf-8?B?QWw=?= Windows XP Work Remotely 1 30th Aug 2006 12:45 PM
How do I force user to have to input their User ID when logging i. =?Utf-8?B?UmljaA==?= Microsoft Outlook Discussion 1 11th Mar 2005 05:49 PM
Change Logging Matt Jensen Microsoft Excel Programming 0 20th Dec 2004 05:48 PM
Can you change "logged-in" user without explicitly logging off? Matt Microsoft Windows 2000 Security 1 21st May 2004 12:23 AM
Copy user profile to new machine without user logging on first =?Utf-8?B?Q2F0ZW1hY28=?= Microsoft Windows 2000 1 17th May 2004 09:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:12 AM.