Hi
I have read the faq on how to set up a report to accept criteria from a list box on a form and whilst I seem to have most of the relevant steps in place I don't seem to be able to tie them together to get it working. I think I am missing a crucial step.
FORM:
I have a form with two list boxes -
the first list box is Country - the row source is my 'Countries' table
the second list box is Pre-sort - with a list of Pre-sort options from another table
The form has a button which just calls up my report - Summary1 for now
Query:
I have a query which formats the data ready for the report and references my form for the criteria:
[Forms]![Desp_Parameter_Form]![Country_Select]
[Forms]![Desp_Parameter_Form]![Presort_Select]
Report:
My report just runs from the form and has no other 'tie in' to the criteria.
When I click the run report button the report opens in preview with no data in it.
i did have a macro embedded in the page_footer.on format event. However, when this was in the report wouldn't run at all and came up with a type mismatch error.
If I remove the criteria above and put a standard [Please enter country] prompt and another for the presort the report work fine. I just wanted to use the listbox to stop any user error in keying in options.
Any help gratefully received as I do not have a clue. It is about 10 years since I did any VB and bags of code just goes right over my head now.
Thanks
I have read the faq on how to set up a report to accept criteria from a list box on a form and whilst I seem to have most of the relevant steps in place I don't seem to be able to tie them together to get it working. I think I am missing a crucial step.
FORM:
I have a form with two list boxes -
the first list box is Country - the row source is my 'Countries' table
the second list box is Pre-sort - with a list of Pre-sort options from another table
The form has a button which just calls up my report - Summary1 for now
Query:
I have a query which formats the data ready for the report and references my form for the criteria:
[Forms]![Desp_Parameter_Form]![Country_Select]
[Forms]![Desp_Parameter_Form]![Presort_Select]
Report:
My report just runs from the form and has no other 'tie in' to the criteria.
When I click the run report button the report opens in preview with no data in it.
i did have a macro embedded in the page_footer.on format event. However, when this was in the report wouldn't run at all and came up with a type mismatch error.
If I remove the criteria above and put a standard [Please enter country] prompt and another for the presort the report work fine. I just wanted to use the listbox to stop any user error in keying in options.
Any help gratefully received as I do not have a clue. It is about 10 years since I did any VB and bags of code just goes right over my head now.
Thanks