I've got application A, with a hidden form, whose unload event is
cancelled unless you use an 'exit' button (so I can do special
processing)
this works fine when using just application A and it prevents me from
'x'ing out of msaccess.exe
now, I open application A from within application B using the code
below
where function editQuote() is found within application A and to provide
application synchronization, it
opens the hidden form mentioned above
waits for it to become invisible, by using the 'exit' button,
after special processing
closes the form
and only then do I get to label 'xx'
now, if I 'X' out of the msaccess application (A), it triggers the
unload event (per my STOP statement) - but is also gets to label 'xx',
with the application A session still open
then I step through the application A unload event which is properly
cancelled but it's too late
and these lines fail
objAccess.Quit acQuitSaveNone
Set objAccess = Nothing
and I have two access applications running
and I can only kill application A using the task manager
what should happen is
start application B
hit button to start application A, suspending application B until
we 'exit' from application A
resume application B
but if I 'x' out of the application A msaccess.exe, I now have 2 copies
of msaccess running and I can access them both - how can I achieve
'what should happen' ?
Set objAccess = New Access.Application
DoEvents
With objAccess
.RefreshTitleBar
.Visible = False
.OpenCurrentDatabase applicationPath & "\" & strConfig
DoEvents
On Error Resume Next
.RunCommand acCmdAppRestore
DoEvents
.Run "editQuote", CStr(strProductId), CLng(lngQuoteId),
CStr(strSuffix), blnView
xx:
On Error GoTo fErr
End With
configure = True
fExit:
On Error Resume Next
objAccess.Quit acQuitSaveNone
Set objAccess = Nothing
Exit Function 3 2346
the easiest way to avoid the problem might be to disable the "X" button in
software's title bar, so the user has no choice but the use the custom Exit
button you provide. i use the code found at http://support.microsoft.com/?id=258049 in my A97 app, and it works great.
hth
<le*********@natpro.comwrote in message
news:11**********************@45g2000cws.googlegro ups.com...
I've got application A, with a hidden form, whose unload event is
cancelled unless you use an 'exit' button (so I can do special
processing)
this works fine when using just application A and it prevents me from
'x'ing out of msaccess.exe
now, I open application A from within application B using the code
below
where function editQuote() is found within application A and to provide
application synchronization, it
opens the hidden form mentioned above
waits for it to become invisible, by using the 'exit' button,
after special processing
closes the form
and only then do I get to label 'xx'
now, if I 'X' out of the msaccess application (A), it triggers the
unload event (per my STOP statement) - but is also gets to label 'xx',
with the application A session still open
then I step through the application A unload event which is properly
cancelled but it's too late
and these lines fail
objAccess.Quit acQuitSaveNone
Set objAccess = Nothing
and I have two access applications running
and I can only kill application A using the task manager
what should happen is
start application B
hit button to start application A, suspending application B until
we 'exit' from application A
resume application B
but if I 'x' out of the application A msaccess.exe, I now have 2 copies
of msaccess running and I can access them both - how can I achieve
'what should happen' ?
Set objAccess = New Access.Application
DoEvents
With objAccess
.RefreshTitleBar
.Visible = False
.OpenCurrentDatabase applicationPath & "\" & strConfig
DoEvents
On Error Resume Next
.RunCommand acCmdAppRestore
DoEvents
.Run "editQuote", CStr(strProductId), CLng(lngQuoteId),
CStr(strSuffix), blnView
xx:
On Error GoTo fErr
End With
configure = True
fExit:
On Error Resume Next
objAccess.Quit acQuitSaveNone
Set objAccess = Nothing
Exit Function
thanks
tina wrote:
the easiest way to avoid the problem might be to disable the "X" button in
software's title bar, so the user has no choice but the use the custom Exit
button you provide. i use the code found at http://support.microsoft.com/?id=258049 in my A97 app, and it works great.
hth
<le*********@natpro.comwrote in message
news:11**********************@45g2000cws.googlegro ups.com...
I've got application A, with a hidden form, whose unload event is
cancelled unless you use an 'exit' button (so I can do special
processing)
this works fine when using just application A and it prevents me from
'x'ing out of msaccess.exe
now, I open application A from within application B using the code
below
where function editQuote() is found within application A and to provide
application synchronization, it
opens the hidden form mentioned above
waits for it to become invisible, by using the 'exit' button,
after special processing
closes the form
and only then do I get to label 'xx'
now, if I 'X' out of the msaccess application (A), it triggers the
unload event (per my STOP statement) - but is also gets to label 'xx',
with the application A session still open
then I step through the application A unload event which is properly
cancelled but it's too late
and these lines fail
objAccess.Quit acQuitSaveNone
Set objAccess = Nothing
and I have two access applications running
and I can only kill application A using the task manager
what should happen is
start application B
hit button to start application A, suspending application B until
we 'exit' from application A
resume application B
but if I 'x' out of the application A msaccess.exe, I now have 2 copies
of msaccess running and I can access them both - how can I achieve
'what should happen' ?
Set objAccess = New Access.Application
DoEvents
With objAccess
.RefreshTitleBar
.Visible = False
.OpenCurrentDatabase applicationPath & "\" & strConfig
DoEvents
On Error Resume Next
.RunCommand acCmdAppRestore
DoEvents
.Run "editQuote", CStr(strProductId), CLng(lngQuoteId),
CStr(strSuffix), blnView
xx:
On Error GoTo fErr
End With
configure = True
fExit:
On Error Resume Next
objAccess.Quit acQuitSaveNone
Set objAccess = Nothing
Exit Function
you're welcome :)
<le*********@natpro.comwrote in message
news:11*********************@l39g2000cwd.googlegro ups.com...
thanks
tina wrote:
the easiest way to avoid the problem might be to disable the "X" button
in
software's title bar, so the user has no choice but the use the custom
Exit
button you provide. i use the code found at http://support.microsoft.com/?id=258049 in my A97 app, and it works
great.
hth
<le*********@natpro.comwrote in message
news:11**********************@45g2000cws.googlegro ups.com...
I've got application A, with a hidden form, whose unload event is
cancelled unless you use an 'exit' button (so I can do special
processing)
>
this works fine when using just application A and it prevents me from
'x'ing out of msaccess.exe
>
>
now, I open application A from within application B using the code
below
where function editQuote() is found within application A and to
provide
application synchronization, it
opens the hidden form mentioned above
waits for it to become invisible, by using the 'exit' button,
after special processing
closes the form
>
and only then do I get to label 'xx'
>
now, if I 'X' out of the msaccess application (A), it triggers the
unload event (per my STOP statement) - but is also gets to label 'xx',
with the application A session still open
>
then I step through the application A unload event which is properly
cancelled but it's too late
and these lines fail
objAccess.Quit acQuitSaveNone
Set objAccess = Nothing
>
and I have two access applications running
and I can only kill application A using the task manager
>
>
what should happen is
start application B
hit button to start application A, suspending application B until
we 'exit' from application A
resume application B
>
but if I 'x' out of the application A msaccess.exe, I now have 2
copies
of msaccess running and I can access them both - how can I achieve
'what should happen' ?
>
>
Set objAccess = New Access.Application
DoEvents
With objAccess
.RefreshTitleBar
.Visible = False
.OpenCurrentDatabase applicationPath & "\" & strConfig
DoEvents
On Error Resume Next
.RunCommand acCmdAppRestore
DoEvents
.Run "editQuote", CStr(strProductId), CLng(lngQuoteId),
CStr(strSuffix), blnView
xx:
On Error GoTo fErr
End With
>
configure = True
fExit:
On Error Resume Next
objAccess.Quit acQuitSaveNone
Set objAccess = Nothing
Exit Function
>
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Peter Frost |
last post by:
Please help
I don't know if this is possible but what I would really like to do is
to use On Error Goto to capture the code that is being executed when
an error occurs.
Any help would be much...
|
by: dlieu |
last post by:
I've found an odd situation in where the Load event of the active form
fires (after the Unload event) when Access is closed. I am able to
reproduce this situation in Access 2002 SP3 and Access 2003...
|
by: David Sullivan |
last post by:
Hi
I have a problem with a database where certain users are closing access (by
clicking on the X in top right-hand corner) instead of using a command
button before they fill in all relevant...
|
by: alecjames1 |
last post by:
I have a form which the user must complete before closing. I have
disabled the window x button and use my own exit button. When selected
it checks to see if the user has completed the entries...
|
by: Claudia Fong |
last post by:
Hi,
I have more than one forms in my program, and I would like to for
example, in form1, I will call form2 and in form2 it will call form3.
But the problem is when I call form2.Show, it does...
|
by: Joner |
last post by:
Hello,
I'm having trouble with a little programme of mine where I connect to
an access database. It seems to connect fine, and disconnect fine, but
then after it won't reconnect, I get the error...
|
by: Lauren Wilson |
last post by:
Hi folks,
I believe I have seen this in this group in the past but my search
comes up with nothing so far.
I want to prevent our Access application from closing without some
kind of...
|
by: PW |
last post by:
Hi,
I want to add code to check if the user wants to save the record
(fields are unbound) when they press the form's close (X) button.
Is it possible to return the user to the form if there...
|
by: etuncer |
last post by:
Hello All,
I have Access 2003, and am trying to build a database for my small
company. I want to be able to create a word document based on the data
entered through a form. the real question is...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| | |