G
Guest
Hi all,
I have tried inserting data with the following insert statement in my codes. When this code is executed, I got the error "too few parameters, expected 4". I have no idea where did my sql statement went wrong. Please help me. Thank you!
---start of codes---
Set db = CurrentDb()
StrSQL = "INSERT INTO tblFeesInfo ( IDNo, StudentName, Surname, Item, Description, Rate, Qty, Amount, Address, Names, Today, DueDate, PymtMonth ) SELECT IDNo, StudentName, Surname, Item, Description, Rate, Qty, Amount, Address, (select siblings from tblsiblings where address = qryBasicFees.address) AS [Names], Today, DueDate, PymtMonth FROM qryBasicFees"
db.Execute StrSQL, dbFailOnError
---end of codes---
I've put the above codes in the Report_Active()
Actually [IDNo], [StudentName], [Surname], [Item], [Description], [Rate], [Qty], [Amount], [Address] are all the fields in qryBasicFees.
Whereas [Today], [DueDate], [PymtMonth] are fields in the report that execute this code.
I have tried inserting data with the following insert statement in my codes. When this code is executed, I got the error "too few parameters, expected 4". I have no idea where did my sql statement went wrong. Please help me. Thank you!
---start of codes---
Set db = CurrentDb()
StrSQL = "INSERT INTO tblFeesInfo ( IDNo, StudentName, Surname, Item, Description, Rate, Qty, Amount, Address, Names, Today, DueDate, PymtMonth ) SELECT IDNo, StudentName, Surname, Item, Description, Rate, Qty, Amount, Address, (select siblings from tblsiblings where address = qryBasicFees.address) AS [Names], Today, DueDate, PymtMonth FROM qryBasicFees"
db.Execute StrSQL, dbFailOnError
---end of codes---
I've put the above codes in the Report_Active()
Actually [IDNo], [StudentName], [Surname], [Item], [Description], [Rate], [Qty], [Amount], [Address] are all the fields in qryBasicFees.
Whereas [Today], [DueDate], [PymtMonth] are fields in the report that execute this code.