Thank you very much for your time to look on my problem and wrote me the code. I appreciated all your works. I have tried to apply it into my database like the way you show me, but I got the error at this line
Set rstOrder = dbs.OpenRecordset(strsql, 4)
Run time error ‘3061’ too few...