Open Report with multiple requery

  • Thread starter Thread starter Daniel
  • Start date Start date
D

Daniel

Hi

I need to open a report with multiple requery but my code doesn't work
The report alway use the default requery, it never use my custom requery.

Here an example:

if choice =1 then
doCmd.OpenReport "myreport", acViewPreview, "myrequery1"
else
doCmd.OpenReport "myreport", acViewPreview, "myrequery2"
endif

Thanks
 
Daniel,

By "default requery", I presume you mean myrequery1.

If so, it must be true that choice never has a value of anything but 1.
Check the value by inserting a Msgbox statement before the If clause:

Msgbox choice

Hope that helps.
Sprinks
 
Back
Top