How do I close a currently opened MsgBox using VBA?

Jaison picture Jaison · Jul 16, 2009 · Viewed 24.5k times · Source

Is there any option to close the currently opened MsgBox using any code in VBA access form application?

Answer

Jay Riggs picture Jay Riggs · Jul 16, 2009

Check out Randy Birch's response on this thread in microsoft.public.vb.general.discussion

He recommends creating a function in a .bas file called MsgBox. Doing so will cause VB to call your function rather than the built in one.

You'd then create your own MsgBox form and build in a timer to close your form after a set period of time. He provides links showing how to do this.

He also discusses a way to explicitly call the built in MsgBox function in case you need to do this.

Note: I've never done this but I've found that Randy Birch is a knowledgeable resource.