|
-
Thread Starter
PowerPoster
how to close Access aplication if is opened
How to close Access aplication if is opened?
-
Re: how to close Access aplication if is opened
The first thing that I would try is clicking in the X in the right top of the window.
-
Re: how to close Access aplication if is opened
If that doesn't work, right-click your taskbar, select task manager, select Access, right-click it, and say 'End Task'.
Now, if you want to do it from VB6, there are several posts that have discussed how to kill a task, some that I have posted. But I'll let you search for those. Do you need instructions on how to search?
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
-
Lively Member
Re: how to close Access aplication if is opened
Solution 1 shows how to close the application:
Code:
Declare Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As Long) As Long
Declare Function PostMessageA Lib "user32" (ByVal hWnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Sub CloseAccess()
Const WM_CLOSE = 16
Dim hWnd As Long
hWnd = FindWindowA("OMAIN", 0)
If hWnd <> 0 Then
PostMessageA hWnd, WM_CLOSE, 0, 0
End If
End Sub
To terminate the processus;
Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process")
For Each objItem In colItems
If StrComp(objItem.Name, "MsAccess.exe", vbTextCompare) = 0 Then
objItem.Terminate
End If
Next
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|