Display random msgbox at logon

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to have Access display any one of about 20 different messages
when a user logs on to the database. I would like to remind users of general
departmental tasks, database features, etc. similar to the "tips" that some
software offers to display. Can it be done?
 
You probably don't want it to be random. I would guess you want it to cycle
through all messages before it repeats. This should also be unique to each
user, rather than global.

I would suggest using the registry to store the last displayed message,
retrieve the value when the db starts up, and then have your code choose the
next message in the table.

Something like this:

'Air code...
Private Sub Form_Open(Cancel As Integer)
Dim intLastMessage As Integer
Dim strMessage As String
intLastMessage=CInt(GetSetting("MyAppName","StartUp","LastMsgId","0"))
intMessage=intMessage+1
SaveSetting "MyAppName","Startup","LastMsgId", intMessage
If intMessage> DMax("MsgId","tblMessages") Then
intMessage=DMin("MsgId","tblMessages")
End If
strMessage=DLookup("MessageText","tblMessages","MsgId = " & intMessage)
Msgbox strMessage, VbOkOnly, "Tip of the Day"
End Sub

HTH,
Barry
 
Use a two field table - number & message. On start use table message from
query sorted on number field, TOP 1, and then update with random number.
 
Back
Top