Deadline alert at m-1 / MsgBox (Access)

arno08000 -  
blux Posted messages 5028 Registration date   Status Moderator Last intervention   -
Hello,

I’m creating a database in Access to manage staff for a small association. I have a form with a date field that shows career evolution dates. I’d like that when opening the form, a MsgBox labeled "alert" appears when a change is scheduled for the following month.
Example: a change is scheduled for 01/07/06; I’d like the message box to appear starting June 1.
I’ve already tried by creating an event procedure on form activate or on focus received, type:

If DateDiff("d", Date, Date_Chgt_Palier) = -30 Then msgbox ("Alerte")
but it doesn’t work

Maybe I should put a condition in the MsgBox created as a macro, but I don’t know anything about that. please help me! thank you

1 answer

blux Posted messages 5028 Registration date   Status Moderator Last intervention   3 455
 
Hi,

when you say: it doesn’t work, what exactly isn’t working?

It seems to me, however, that you should still have other issues since your test isn’t done on all the members of your association.

I suppose you would need to check each member to display, because currently, we don’t know where your dates come from...

--
See you, Blux
 "The idiots dare everything. That’s how you can tell them apart"
0
arno08000 Posted messages 2 Status Member 1
 
Hi, actually, my dates are in a continuous form mode (form name "evolution" or in one field the names of the people and in another field the date of their evolution). So I entered the quoted formula in the event procedure on activation and on focus gain, and I get no error message when opening the form, but the MsgBox never appears, even if I change the system date or the evolution dates to match the current date. that's why I say it doesn't work! Thanks @+ arno
0
blux Posted messages 5028 Registration date   Status Moderator Last intervention   3 455
 
Did you put your code in the form or in one of the form's zones?

It has to be in a part of the form that receives focus (typically, the name display)...

--
A+ Blux
 "Les cons, ça ose tout. C'est même à ça qu'on les reconnait"
0