Running a certain macro if conditions are met

  • Thread starter Thread starter access wiz
  • Start date Start date
A

access wiz

I have a simple form in which I have added Command Buttons which go to the
previous record and the next record. I have also added a condition to Go To
Next Record/Previous record that alerts me when I haven't contacted the
person in 30 days:

MsgBox
[Forms]![New Millimax]![last_contact]<=Now()-30

The annoyance of this is when I am scrolling through the records I
constantly keep getting the pop notice which is quite helpful at first but
not if I am not looking for that information. I want to create a option
button which turns this searching for last contacted off. I have tried the
IIf statement and don't believe I am doing it correctly. Does anyone have an
answer?
 
Wiz,

First of all, since the macro is running on the New Millimax form, you
don't need to specifiy. Secondly, I would use Date() rather than Now()
since you don't need to include time component.

You could put an unbound checkbox in the Form Header, set its Default
Value to 0, and then you can tick the box if you want the last contact
functionality. Let's say you name the checkbox CheckContacts. Then the
macro Condition would be like this:
[CheckContacts] And [last_contact]<=Date()-30
 
Back
Top