Connecting Tech Pros Worldwide Forums | Help | Site Map

Setting an alert on a form

Member
 
Join Date: Aug 2007
Posts: 111
#1: Aug 27 '07
On my form i have a button that opens up a new form for adding notes. Next to the button i have a text box that i want to display "New Notes!" when someone adds new notes. How would i go about doing this? The notes form and the original form are based on two different tables linked by GroupNumber. I'm guessing i have to set my OnOpen event of the original form to check if new notes have been added since the last time they opened the form, but im not sure how to code this. Am i on the right track at least?
FishVal's Avatar
Expert
 
Join Date: Jun 2007
Location: Israel
Posts: 2,584
#2: Aug 27 '07

re: Setting an alert on a form


Quote:

Originally Posted by Neekos

On my form i have a button that opens up a new form for adding notes. Next to the button i have a text box that i want to display "New Notes!" when someone adds new notes. How would i go about doing this? The notes form and the original form are based on two different tables linked by GroupNumber. I'm guessing i have to set my OnOpen event of the original form to check if new notes have been added since the last time they opened the form, but im not sure how to code this. Am i on the right track at least?

Hi, Neekos.

There are at least two approaches.
  • add to Notes table boolean field (let us say [blnViewed]) indicating a note was/wasn't viewed; this case you can check whether there are records where [blnViewed]=False on Form_Open event and either update all records to [blnViewed]=True on Form_Close event or update [blnViewed] for a particular record when it is actually opened in notes form handling Form_Current event
  • add to Notes table datestamp field (m/d/y h/s) (let us say dteNoteDateStamp), log in separate table main form openings as datestamp (let us say dteFormOpenDateStamp) and on Form_Open event check whether there are records where dteNoteDateStamp>Max(dteFormOpenDateStamp)

To my mind the first solution is more flexible.
Reply