RunApp - CloseApp? (1 Viewer)

Lance R Peck

Registered User.
Local time
Today, 04:34
Joined
Feb 14, 2000
Messages
10
I have an application that starts with a command button on a form (macro using the RunApp command).

I need to close the application with a command button. How can I do this?
 

nick

Registered User.
Local time
Today, 04:34
Joined
Mar 27, 2000
Messages
12
Quit in a macro or Docmd.quit in code always does it for me...
 

Lance R Peck

Registered User.
Local time
Today, 04:34
Joined
Feb 14, 2000
Messages
10
The application I want to close is not Access.
The Quit or DoCmd seem only to close Access.

Is there a way I can close the application from within Access?

Here's what I have:
Macro for RunApp that has the command:
C:\Programs\my application

From a form I need a way to close:
C:\Programs\my application

Any more ideas or help appreciated.
 

nick

Registered User.
Local time
Today, 04:34
Joined
Mar 27, 2000
Messages
12
What is the application, if it was word for exmaple you could create an instance of word as an object and then control word with commands like

objmsword.filesaveas

I assume the quit command would work too. this may help
 

Lance R Peck

Registered User.
Local time
Today, 04:34
Joined
Feb 14, 2000
Messages
10
The application is a small .exe file that I use with access. I start it with a RunApp macro and it will run on top of access. When I close a form with a command button I need it to also close the other application.
 

doulostheou

Registered User.
Local time
Yesterday, 22:34
Joined
Feb 8, 2002
Messages
314
I have made an alarm clock, and implemented the function given in the first link. I use it to close down windows media player. after a specified amount of time has passed. But for some reason, access periodically freezes on me. Sometimes the code works fine, and other times it locks up the whole application. Can anyone see a mistake in my code which would cause access to lock up?

(I have the timer set to 1000 so the timer event runs every second)


Private Sub Form_Timer()
CurrentTime = Time()
If Not IsNull(AlarmTime) Then
Dim theHour As String
Dim theMin As String
Dim AlarmHour As String
Dim AlarmMin As String
Dim StopHour As String
Dim StopMinute As String
theHour = Hour(CurrentTime)
theMin = Minute(CurrentTime)
If Not IsNull(AlarmTime) Then AlarmHour = Hour(AlarmTime)
If Not IsNull(AlarmTime) Then AlarmMin = Minute(AlarmTime)
If Not IsNull(StopTime) Then StopHour = Hour(StopTime)
If Not IsNull(StopTime) Then StopMinute = Minute(StopTime)
If theHour = AlarmHour And theMin = AlarmMin And Check = 0 Then
FollowHyperlink "T:\Sups Only\Computer Research/song.m3u"
Check = -1
StopTime = DateAdd("n", 5, AlarmTime)
ElseIf theHour = StopHour And theMin = StopMinute And Check = -1 Then
fCloseApp ("Media Player 2")
End If
End If
End Sub

Private Sub Set_Click()
AlarmTime = InputBox("What time do you want to set the alarm for?", "Set Alarm", , 50, 100)
Check = 0
End Sub

Private Sub Snooze_Click()
fCloseApp ("Media Player 2")
AlarmTime = DateAdd("n", 3, CurrentTime)
Check = 0
End Sub
 

Users who are viewing this thread

Top Bottom