Hi folks

I don't know what is happening with the following code. When there are no records in the table tblbatchdetails and the person try to insert a record then in the following function the error comes at dmax statement. But if I make this line comments and try to insert the record 2 or 3 times then the code works perfectly fine. If after that I remove the comments from that line and try to run the following code then it starts working absolutely fine. I think when there are no records in the table for particular date then the code gives problem otherwise dmax statement works fine.
Please Login or Register  to view this content.
Any suggestions anyone please?

Thanks
Aman