473,395 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to get Access to Display a Message Alert for New Records?

Hello,

I have a project management database that tracks the status of various projects that have been assigned to users. I was wondering if there is a way to get MS Access to beep and display an alert box when a user has a newly assigned project? The database has a main project form (FRM_staff_project) that uses qry_staffprojects as the source of the project data. The main form is a split form.

A newly assigned project would have a value of 7 in the Status_ID field (which translates to "New"). A newly assigned project would also have a value of 0 in the Order field.

Any help would be appreciated! Attached are pictures of the main form and query.


Thanks,
Karen

PS The main form includes a subform that runs VBA on load (Thanks to Twinnyfo and NeoPa).

For more details regarding the subform, please see Open Subform to Record Closest to Today


Attached Images
File Type: jpg frm_staff_projects.jpg (67.1 KB, 531 views)
File Type: jpg qry_staffprojects.jpg (82.3 KB, 573 views)
May 6 '18 #1
5 2074
PhilOfWalton
1,430 Expert 1GB
Hi Karen

How I hate split forms. You will get much the same information using a form & subform where you are in charge of what information is displayed, how it is displayed, rather than Access being in charge.

That aside.

Have you considered adding a Yes/No field called "ProjectSeen" to your project table with a default value of "No". Then on the continuos subform (Split form if you will) have a check box which you can set to ProjectSeen = "Yes"

Rather than using a Message box to indicate that there is a new project, I would use conditional formatting to highlight any project that still has the ProjectSeen flag set to "No"

This has the advantage that if a user has more than 1 new project assigned to them, they are all highlighted.

Phil
May 7 '18 #2
twinnyfo
3,653 Expert Mod 2GB
You could also have the DB generate an e-mail for the specified user. Then, whenever a new project is assigned, they receive an e-mail that informs them. Is is a bit of a greater leap of overhead, but it just depends on what. You want to do and how you want the DB to do it.
May 7 '18 #3
Right now, new assignments appear at the the top the list and the status is bolded. Unfortunately, some people are not noticing their new assignments. Ideally, they do want to receive an e-mail listing the newly assigned projects but also want a more visible/audible alert when they open the project form if possible. Karen
May 7 '18 #4
twinnyfo
3,653 Expert Mod 2GB
Karen,

This may be a bit more than you are willing/able to digest at this point, but you may want to check out this article on How to Create User Permissions and Customized Menus in Access. You may be able to use some of the same principles found there in notifying users of new assignments with various pop up forms or notifications.

Even so, I think Phil’s idea of having a “ProjectSeen” flag is a good one. It is a simple concept, but implementing it may be tricky. In the corporate world, think about how many times you get pop up warnings from your IT department and you simply ignore what it says or just click OK....

A more bold approach may be to allow each user to see a list of their assignments (a printable report). Then, there is no question that they have accsss to their assignments.

There are many ways to skin this cat, and we can work through options with you.
May 8 '18 #5
Thanks Twinnyfo and PhilofWalton,

I might be able to implement those suggestions in the future. However, right now they're pretty set on this approach. The issue is more that they don't recognize that they have new projects even though the new projects are listed at the top the list. I was able to develop coding that appears to work. However, it seems to interfere with the functioning of the vba code in the subform. Specifically, the subform no longer opens to the record closest to today. Here's the vba coding for the main form (this is an event procedure in FRM_staff_project):

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. DoCmd.SetOrderBy "[Order], [Due Date]"
  3.  
  4. On Error GoTo Done
  5.     Dim db          As DAO.Database
  6.     Dim rstb         As DAO.Recordset
  7.     Dim strSQLb      As String
  8.     Dim TheOrd     As Long
  9.     Dim lngStaffb    As Long
  10.  
  11.  
  12.     lngStaffb = Me.ID_staff
  13.  
  14.          strSQLb = "SELECT Min(Order) as Ord " & _
  15.             "FROM qry_staffprojects_test " & _
  16.             "WHERE (ID_staff = " & lngStaffb & ")"
  17.  
  18.         Set db = CurrentDb
  19.         Set rstb = db.OpenRecordset(strSQLb)
  20.  
  21.        TheOrd = rstb.Fields(0)
  22.  
  23. If TheOrd = 0 Then
  24. Beep
  25. MsgBox ("You Have New Projects!  Please update the Status and Start Date.")
  26. End If
  27.         rstb.Close
  28.         db.Close
  29.         Set rstb = Nothing
  30.         Set db = Nothing
  31.  
  32.  
  33. Done:
  34.     Exit Sub
  35. End Sub
Here's the vba code from the subform with the milestones (an event procedure in frmvw_milestones):

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. On Error GoTo Done
  3.  Dim db As DAO.Database
  4.     Dim rst As DAO.Recordset
  5.     Dim strSQL As String
  6.     Dim TheDate As Date
  7.      Dim lngStaff As Long
  8.  
  9.     Set db = CurrentDb
  10.  
  11.  
  12.     lngStaff = Me.ID_staff
  13.  
  14.  
  15.     strSQL = "SELECT max(Milestone_Date) as Dte " & _
  16.         "FROM qryvw_milestones " & _
  17.         "WHERE ((Milestone_Date<=now()) " & _
  18.         "AND (ID_staff = " & lngStaff & "))"
  19.     Set rst = db.OpenRecordset(strSQL)
  20.     TheDate = rst.Fields(0)
  21.     Me.Milestone_Date.SetFocus
  22.     DoCmd.FindRecord TheDate
  23.     Me.Milestone_Date.SetFocus
  24.  
  25.  
  26. Done:
  27. Exit Sub
  28.  
  29. End Sub
  30.  
Again, the subform works perfectly without the added coding in FRM_staff_project. However, it now seems to be unable to either focus on the milestone date and/or execute the DoCmd.FindRecord method. Everything in the subform above the last three lines appears to be still working fine ("TheDate" returns the correct date when I added a message box to debug).

Karen
May 10 '18 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Robert | last post by:
I am trying to send an email message from the code behind page of an aspx page. Here is what I have: ======================================= Imports System.Web.Mail Private Sub EmailStuff()
1
by: nithasha | last post by:
Hi, I need to display a message " NO EMPLOYEES TO REPORT" after the Top Title in a SQLPLUS report when no rows are retrieved by a select statement. So how do i go about? Regards, Nithasha.
2
by: anoop | last post by:
Hello, I want to display message from .aspx.vb code behind file. I want to display data from SQL DataReader in the Message. what should I do. Thank you
1
by: cmrhema | last post by:
Hi, I am working in asp.net+ajax. I do not know where to put this question. I guess i am in the right place I am using ajax update control panel. I have three dropdownlist inside it. Now the...
1
by: khalid Ahmed | last post by:
Hi, I'm using ASP.NET custom membership provider, I have created a list of users and their roles in a single XML file. I'm using three login controls in my app, one located at Admin/login.aspx...
1
by: Naushad | last post by:
Hi All Our Company is provided courses to employees for one or more days i.e. there are three field (EmpNo, StartDate and EndDate) of course. I am trying to display an Alert message when a...
21
by: mukeshrasm | last post by:
Hi I am deleting records from database using checkbox. means only that record will be deleted from database which are selected in checkbox. and before deleting record I am displaying a message...
9
ullevi83
by: ullevi83 | last post by:
Guys, First post on Byte, so hello all! I was wondering if I could pick somones brain regarding what I hoped would be an easy message display function, unfortunately it is causing me a lot of...
2
by: shaliniraji | last post by:
Hi Everyone, I would like to display application form as tabular format for that am using crystal report viewer..Here my issue is in my table I have bulk of data's but when i run...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.