[AccessD] A2K: This should be easy

Darren DICK d.dick at uws.edu.au
Thu Mar 20 22:29:00 CST 2003


Hi Stuart
You are da man!!!!!!!!!!!!!!!!!!!!!!
We have lift off.
Many many thanks

Darren


-----Original Message-----
From: accessd-admin at databaseadvisors.com
[mailto:accessd-admin at databaseadvisors.com]On Behalf Of Stuart McLachlan
Sent: Friday, 21 March 2003 10:52 AM
To: Darren Dick; accessd at databaseadvisors.com
Subject: RE: [AccessD] A2K: This should be easy


On 19 Mar 2003 at 10:53, Darren Dick wrote:

> Hi Stuart
> The following code just won't work, even with your 'time' suggestion
<sigh>
> I must be missing something really obvious. This should work.
>

A couple of things I messed up in my original example. That's what happens
when you write code directly in an email
client and don't debug :-(

(rs!BookingTime - cmbInterval / dblMinutes) >= Time()

Should be:

Time => (rs!BookingTime - cmbInterval * dblMinutes)

In my first example, we need to mulitpy by the fractional dblMinutes, not
divide by it (that's why you would have been
getting dates in then 1860s or whatever.

We need it to trigger after the  notice time, not before it!


This one has been tired in A2K and worked as expected:

Private Sub Form_Timer()
Dim rs As DAO.Recordset
Dim dblMinutes As Double
dblMinutes = 1 / 24 / 60
 If IsNull(cmbInterval) Then Exit Sub

 Set rs = Me.Recordset
     While Not rs.EOF
         If Time() >= (rs!BookingTime - cmbInterval * dblMinutes) And Not
rs!WarningDone Then
              MsgBox rs!Message
               rs.Edit
               rs!WarningDone = True
               rs.Update
         End If
         rs.MoveNext
     Wend
End Sub
--
Stuart McLachlan
Lexacorp Ltd
Application Development,  IT Consultancy
http://www.lexacorp.com.pg

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list