View Full Version : Create report from form


newtoitall
03-13-2007, 05:57 AM
Hi trying to create report from an open form. Created button and inserted the following line of code that work OK!

DoCmd.OpenReport "rptTEST", acViewPreview, , "[name]=Forms!frmTEST!name

However when I add another condition to the WHERE part of the line, The report returns nothings. The line looks like this;

DoCmd.OpenReport "rptTEST", acViewPreview, , "[name]=Forms!frmTEST!name And "[date]=Forms!frmTEST!date

Is there something wrong with this line, or is there something else causing this behaviour?

Dennisk
03-13-2007, 06:00 AM
two things DATE is a reserved word and shouldn't be used
"[name]=Forms!frmTEST!name And [date]=#" & Forms!frmTEST!date & "#"