Respected,I have a table name (fee) which have the following fields:it will only send one message and not send other messges which dues is unpaid...please advised. -----------------------------------------------------------------------GR No: 1, 2,3,4,5,6,7Name: Aslam,Naveed,Wasif,Altaf etcDate, Month, Year, TutFee, Exam, Comp, Other, Payable, Paid, Balance-----------------------------------------------------------------------i want to send the unpaid dues messges to parents whose dues is not paid afterdate 10-01-2013.i have put the following code in form open event:----------------------------------------------------------------------Private Sub Form_Open(Cancel As Integer)On Error GoTo ErrorHandlerDoCmd.SetWarnings FalseDim StrSQl As StringDim a As Datea = DateDim D As IntegerD = Day(a)If D > 10 And Me.Paid = 0 Or Me.Paid = "" ThenDim dbs As Database, rst As RecordsetSet dbs = CurrentDbSet rst = dbs.OpenRecordset("SELECT Fees.* " _& "FROM Fees WHERE [GR No]=" & "" & Me.[GR No] & "" And Me.Paid = 0)If Not rst.EOF ThenMe.T = DLookup("Mobile", "Student", "[GR No]" = "[GR No]")StrSQl = "Insert into MsgOut (iid,msg,send,msgto) values('[GR No]','Respected Parents!Your Child Fees Has Been Due..Please Paid the dues as eraliest...','Yes',T);"DoCmd.RunSQL (StrSQl)End IfEnd IfExitHandler
oCmd.SetWarnings TrueExit SubErrorHandler:MsgBox Err.Number & Chr(13) & Err.DescriptionResume ExitHandlerEnd Sub
