calling value from a combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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 &' "
 
I figured out the Parameter Dialog Box issue....however, now, all I get is a
blank report....any ideas?
 
your syntax needs the apostrophes inside quotes
DoCmd.OpenReport "rptMyReport", acViewPreview, , "[Template Version] = '" &
frmAndover_TemplateMenu.TemplateVersion & "'"
 
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 &' "
 
Back
Top