calling value from a combo box

  • Thread starter Frustrated in Formland
  • Start date
F

Frustrated in Formland

I have a form with an unbound combo box. Essentially, I am opening a report
which uses the value in the combo box as a filter for the report. I know I
am close because when the code is executed, instead of the report, I get a
Parameter Value Dialog Box. Could someone please look at my code and help me
sort out the errors? I really appreciate it.

DoCmd.OpenReport "rptMyReport", acViewPreview, , "[Template Version] =
'& frmAndover_TemplateMenu.TemplateVersion &' "
 
F

Frustrated in Formland

I figured out the Parameter Dialog Box issue....however, now, all I get is a
blank report....any ideas?
 
D

Dennis

your syntax needs the apostrophes inside quotes
DoCmd.OpenReport "rptMyReport", acViewPreview, , "[Template Version] = '" &
frmAndover_TemplateMenu.TemplateVersion & "'"
 
F

Frustrated in Formland

Hi Dennis,

Thanks for replying. When I put the apostrophes inside the quotes I get a
compile error: end of statement expected....any ideas?

Dennis said:
your syntax needs the apostrophes inside quotes
DoCmd.OpenReport "rptMyReport", acViewPreview, , "[Template Version] = '" &
frmAndover_TemplateMenu.TemplateVersion & "'"

Frustrated in Formland said:
I have a form with an unbound combo box. Essentially, I am opening a report
which uses the value in the combo box as a filter for the report. I know I
am close because when the code is executed, instead of the report, I get a
Parameter Value Dialog Box. Could someone please look at my code and help me
sort out the errors? I really appreciate it.

DoCmd.OpenReport "rptMyReport", acViewPreview, , "[Template Version] =
'& frmAndover_TemplateMenu.TemplateVersion &' "
 
F

Frustrated in Formland

Dennis...I figured it out and the report works fine...thanks for all your help
 
Top