Message popups up

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

Guest

I would like a message to popup a newly assigned record with specific
criteria is added to the database. Can this be done?

Example: we have one person that inputs records and assigns them to other
analysts. If a particular type of record is input I want the analyst to
receive a message that popups when they are in access to tell them they have
this new record that isn't closed yet.

Is there a way to do this?
Thanks
 
Yes.
You will need a table that identifies the user, the message, and the primary
key of the record that needs attention. when you want to send a message, you
will have to create a record in that table with the userid and message you
want to send.

Then to make this work, you will have to probably make some modifications to
your database. You will need a form that starts up when you open the
application. You can do that by either using the RunCode in a macro named
Autoexec that runs a function that opens your form, or you can specify the
form in the start up options. If you have a form already doing this, you can
have this new form open the currrent start up form in it's load event.

You can make this form hidden.
Make the message table it's record source.
Create a Timer event for the form.
Set a Timer interval for the form.

When the timer event fires, check to see if there are any messages for the
user. If there are not, continue on. If there are, present a message box
saying there is a message, read it now, yes or no. If the user answers no,
continue on. They will get prompted again on the next time interval. If the
user answers yes, make the hidded form visible so they see the message. Once
they have read the message, delete the record and rehide the form. Then open
whatever form they need positioned on the record that needs attention.
 
So I may be asking too much, but I'm a little lost on the Timer Event.
Could you assist.. I have some programming knowledge but not too much. I get
the jist of what needs to be done, but writing it is a different story.

1. So I created the table with the following fields: ID, LogonID,
RecordID(which has a relationship to the table that holds the record they
need to see), Msg

When each person opens the database the first screen they get is basically a
dropdown where they chose their ID this triggers all the forms and reports
specifically to their entries in the database (probably not the correct way
of doing it but worked for me at the time of development).

2. Created a form using the msg table fields.

3. Set the timer interval to 5

4. Created a form with all the information needed for the important record
they need to see and the form name is FRM_IMTickets

Can you help with the event? If this is asking to much please let me know..
I will figure it out somehow.

Thanks in advance, very much appreciated
 
Lisa said:
So I may be asking too much, but I'm a little lost on the Timer Event.
Could you assist.. I have some programming knowledge but not too much. I get
the jist of what needs to be done, but writing it is a different story.

1. So I created the table with the following fields: ID, LogonID,
RecordID(which has a relationship to the table that holds the record they
need to see), Msg

Perfect. The only other consideration would be if they want to save the
message for later, you might want a Yes/No field to differentiate between new
and saved messages.

I would suggest you use a query as the record source for the form that is
filtered by LogonID. It will make it a faster search when you check for
messages.
When each person opens the database the first screen they get is basically a
dropdown where they chose their ID this triggers all the forms and reports
specifically to their entries in the database (probably not the correct way
of doing it but worked for me at the time of development).

That is okay. You can actually tell who is logged on when you open the
application, but let's leave it like it is for now.
2. Created a form using the msg table fields.

3. Set the timer interval to 5

4. Created a form with all the information needed for the important record
they need to see and the form name is FRM_IMTickets

Can you help with the event? If this is asking to much please let me know..
I will figure it out somehow.

You can set the form's TimerInterval property in Design view. You said you
set yours to 5, but I am not sure what you mean. The value is 1000 per
second, so if you want to check every five seconds, the value would be 5000.
I would try starting with 30 seconds (30000). You can always experiment with
it to see what works best for you.

Then you use the Form's Timer Event. The procedure is to see if there are
any records in the form's recordset. If not, do nothing. If there are, then
present the message box and do what ever needs to be done if the user chooses
to read the message.

Private Sub Form_Timer()

Me.Requery
'This would be a control on the form bound to the Msg
If Not IsNull(Me.txtMsg) Then 'There is a message
If MsgBox("Read The Message Now", vbQuestion + vbYesNO, _
"Message Waiting") = vbYes Then
Call ProcessMessage
End If
End If

Process Message would be a function where you would open the form the use
would need to handle the message.
 
Back
Top