Easy Question About Register

FIFT01

New member
Local time
Today, 02:34
Joined
Aug 19, 2011
Messages
2
Hi Guys, I have read this forum, but i couldn´t find an answer.

I need to create a routine to Compare a Date in a field, that belong to a register, with the current date and then execute another routine that I made. However i have no idea how to make a search register by register in a Access database with VBA.

Thanks.
 
When you say 'Compare Date' with the Current Date, do you mean = or > or <

Having done the comparison, then what?
 
Let me explain,

I have a Field named ReturnDate, another named Client and the logic is that:

if ReturnDate < Date()
Then it runs this routine:
Dim Maildb As Object
Dim MailDoc As Object
Dim Body As Object
Dim Session As Object
Set Session = CreateObject("Lotus.NotesSession")
Call Session.Initialize
Set Maildb = Session.GETDATABASE("", "c:\notes\data\mail\mymail.nsf")
If Not Maildb.IsOpen = True Then
Call Maildb.Open
End If

Set MailDoc = Maildb.CREATEDOCUMENT
Call MailDoc.ReplaceItemValue("Form", "Memo")
Call MailDoc.ReplaceItemValue("SendTo", Client Name)
Call MailDoc.ReplaceItemValue("Subject", "Subject Text")
Set Body = MailDoc.CREATERICHTEXTITEM("Body")
Call Body.APPENDTEXT("Body text here")
'Send the document
'Gets the mail to appear in the Sent items folder
Call MailDoc.ReplaceItemValue("PostedDate", Now())
Call MailDoc.SEND(False)
Set Maildb = Nothing
Set MailDoc = Nothing
Set Body = Nothing
Set Session = Nothing

My Question is how to do this routine for each register and put in the field ClientName the Client of that register.
 

Users who are viewing this thread

Back
Top Bottom