Messagebox at specific time

Jgr4ng3

Registered User.
Local time
Today, 11:36
Joined
Jan 19, 2013
Messages
62
Hello

What I wanted was the ability to input a time on a form, and for a notification to come up at that time basically.
I created a query (Callbacks - Duedatetime) that checks the database where this is stored and returns the maximum (MaxofDue Date/Time) of any times within the past 15 minutes. The query works fine.

I then have a form (MaxofDueDate/Time), which outputs the result of the query in a text box (MaxofDue Date/Time).
I have a Macro on the Ontimer event, set to 15 minute intervals, that is as follows:

OpenForm:
Form Name MaxofDueDate/Time
View Form
Filter Name
Where Condition
Data Mode
Window Mode Hidden

If [Forms]![MaxofDueDate/Time]![MaxOfDue Date/Time] Is Not Null Then

MessageBox
Message ="One or more call-backs are due - please check these now."
Beep Yes
Type Information
Title Callback due.

Else

Close Window
Object Type Form
Object Name Max ofDueDate/Time
Save Prompt

End If

The problem is the messagebox is displayed every fifteen minutes without fail despite there not currently being anything in the textbox MaxofDue Date/Time!

Is there a better way around this? Sorry if I’ve made this very long winded and messy – it’s the only way I could think of doing it!!

Cheers for any help!

Jake.
 
Try
Code:
[COLOR=black][FONT=Verdana]If Not IsNull([Forms]![MaxofDueDate/Time]![MaxOfDue Date/Time]) Then[/FONT][/COLOR]
 
That works perfectly now! Thanks Spikepl. Is my syntax incorrect or should it have worked and yours is just a variation? Just so I know for future.
 
Think I spoke too soon, I thought the 15 mins had passed but turns out they hadnt! Its still bringing up the error despite nothing being in the query and therefore the text box..
 
despite nothing being in the query and therefore the text box.

Have you verified that or is it an assumption? How do you get the result from query to textbox? How do you reset (if you do) the textbox and to what? Null ? vbNullSTring? ""? Do you know how these differ - or not, as the case may be?
 
Hi,

I just opened the form and query and there was no value in the field on the form, and the query was blank - is there a better way to do this then?
 

Users who are viewing this thread

Back
Top Bottom