Running a certain macro if conditions are met

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?
 
S

Steve Schapel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top