C
cghersi
Hi all.
I'm developing an Access application with some VBA code.
There's a form with a subform. This subform shows a list of items.
There's a button to delete one item of the list. This button is linked
to a VBA subroutine which asks for a double-confirmation of the
operation via two MsgBox (I know it's not a good practice, but the
committent specially asked this behaviour...)
The code is the following:
Sub btnErase_Click()
If MsgBox("Are you sure?", vbOKCancel + vbDefaultButton2) = vbCancel
then Exit Sub
If MsgBox("Are you really sure?", vbOKCancel + vbDefaultButton2) =
vbCancel then Exit Sub
....
End Sub
Clicking of the btnErase, the result is that the MsgBox appears
"below" the active window of Access application (that is, the MsgBox
is shown in background and not in foreground as usual).
To see this MsgBox, I have to click on the desktop and then return to
the Access application: in this way the MsgBox is shown in foreground.
Obviously this is not acceptable (when the problem arose the first
time, I passed 30 minutes searching for this hidden MsgBox!!!).
How may I fix this issue? Is there a method to be sure that the MsgBox
is shown in foregroud?
Thank you very much!
Bye
Cristiano
I'm developing an Access application with some VBA code.
There's a form with a subform. This subform shows a list of items.
There's a button to delete one item of the list. This button is linked
to a VBA subroutine which asks for a double-confirmation of the
operation via two MsgBox (I know it's not a good practice, but the
committent specially asked this behaviour...)
The code is the following:
Sub btnErase_Click()
If MsgBox("Are you sure?", vbOKCancel + vbDefaultButton2) = vbCancel
then Exit Sub
If MsgBox("Are you really sure?", vbOKCancel + vbDefaultButton2) =
vbCancel then Exit Sub
....
End Sub
Clicking of the btnErase, the result is that the MsgBox appears
"below" the active window of Access application (that is, the MsgBox
is shown in background and not in foreground as usual).
To see this MsgBox, I have to click on the desktop and then return to
the Access application: in this way the MsgBox is shown in foreground.
Obviously this is not acceptable (when the problem arose the first
time, I passed 30 minutes searching for this hidden MsgBox!!!).
How may I fix this issue? Is there a method to be sure that the MsgBox
is shown in foregroud?
Thank you very much!
Bye
Cristiano