Respcted,
i have a table name fee. which contains the following fields:
GR No
Date
Month
Year
AdmFee
TutFee
ExamFee
Other
Total
Paid
Balance
.................................................. ...............................................
i want to unpaid records insert into another table when the paid field is equal to: zero(0)
If the 9 record of fee table is unpaid.the following code i have written in form_open event only insert only first record 9 times. but i need to insert the all 9 records insert in that table.
please see the code:
have used this code:
On Error GoTo ErrorHandler
DoCmd.SetWarnings False
Dim StrSQl As String
Dim a As Date
a = Date
Dim D As Integer
D = Day(a)
Dim db As DAO.Database
Set db = CurrentDb
'Set rs = DB.OpenRecordset("feesms")
StrSQl = "Insert into MsgOut (iid,msg,send,msgto) " & _
"SELECT [GR No], 'Respected Parents!Your Child Fees Has Been Due..Please Paid the dues as earliest...', 'Yes', Mobile " & _
"FROM feesms " & _
"WHERE [D] > 10 AND ([paid] = 0 Or [paid] IS NULL)"
db.Execute StrSQl, dbFailOnError
ExitHandler:
DoCmd.SetWarnings True
Exit Sub
ErrorHandler:
MsgBox Err.Number & Chr(13) & Err.Description
Resume ExitHandler
-------------------------------------------------------------------
it gives me error: 3061 Too Few Parameters Expected 1
pls advised.
i have a table name fee. which contains the following fields:
GR No
Date
Month
Year
AdmFee
TutFee
ExamFee
Other
Total
Paid
Balance
.................................................. ...............................................
i want to unpaid records insert into another table when the paid field is equal to: zero(0)
If the 9 record of fee table is unpaid.the following code i have written in form_open event only insert only first record 9 times. but i need to insert the all 9 records insert in that table.
please see the code:
have used this code:
On Error GoTo ErrorHandler
DoCmd.SetWarnings False
Dim StrSQl As String
Dim a As Date
a = Date
Dim D As Integer
D = Day(a)
Dim db As DAO.Database
Set db = CurrentDb
'Set rs = DB.OpenRecordset("feesms")
StrSQl = "Insert into MsgOut (iid,msg,send,msgto) " & _
"SELECT [GR No], 'Respected Parents!Your Child Fees Has Been Due..Please Paid the dues as earliest...', 'Yes', Mobile " & _
"FROM feesms " & _
"WHERE [D] > 10 AND ([paid] = 0 Or [paid] IS NULL)"
db.Execute StrSQl, dbFailOnError
ExitHandler:
DoCmd.SetWarnings True
Exit Sub
ErrorHandler:
MsgBox Err.Number & Chr(13) & Err.Description
Resume ExitHandler
-------------------------------------------------------------------
it gives me error: 3061 Too Few Parameters Expected 1
pls advised.
javascript:scroll(0,0);http://www.utteraccess.com/forum/index.php?act=report&t=1998802&p=2322635&st=0