rtod2
asked on
Database message window
Access 2010
How do I set a message window to appear each time my database is opened?
How do I set a message window to appear each time my database is opened?
ASKER
Was trying to avoid an auto-exec macro. Is there any way to make an annotation somewhere that would be obvious, without doing an auto-exec?
If you have a form that opens on startup, you could use the open event to display a message box.
Cheers
JC
Cheers
JC
ASKER
Can you post example?
ASKER
JC, Thank you.
I see your example but can't replicate in my database. Can you use the screencast button in your reply and record a screencast? Audio is unimportant.
I see your example but can't replicate in my database. Can you use the screencast button in your reply and record a screencast? Audio is unimportant.
Not sure about screencast (have not used it before), but here is a screen shot of the opening form in design view and code.
The highlighted code is what creates the message box.
Cheers
JC
openmsg.png
The highlighted code is what creates the message box.
Cheers
JC
openmsg.png
ASKER
JV, Thank you for the screenshot. EE was unavailable to me for a few days. Sorry for the delay. With respect to your screenshot, that is helpful. I see that you added the msg to the form so that when a person clicks the form, it comes up. What I am unclear about is how to make it come up by default, when the database is opened. I am using v2010. I'd appreciate any clarity you can provide.
So far I have the following.
So far I have the following.
Option Compare Database
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
DoCmd.Quit
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
Private Sub Form_Open(Cancel As Integer)
MsgBox "My Opening message", vbCritical, "Before you start, please read this message..."
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You only need this part of the code. (The rest was for the Quit button on the form.)
Private Sub Form_Open(Cancel As Integer)
MsgBox "My Opening message", vbCritical, "Before you start, please read this message..."
End Sub
Cheers
JC
Private Sub Form_Open(Cancel As Integer)
MsgBox "My Opening message", vbCritical, "Before you start, please read this message..."
End Sub
Cheers
JC
ASKER
Excellent!
test this
ChartInd1.12.accdb