opening a report from a list box

  • Thread starter Thread starter Michael Hanlon
  • Start date Start date
M

Michael Hanlon

I have a report called PSO Basic and i need the user to choose who the
report is on from a list box that includes personal.

Docmd.openreport "pso basic", acviewpreview,, "[empid]=" & "'" &
me![lstempid] & "'"

when I run the command I just get a blank line on the report.
where did I go wrong.

the list box contains 4 parts of a table on empy. They are empid, Name,
Init, Dept.
Empid is the one linked. the bound is set at 1

Thanks for any help
 
Try:
Docmd.openreport "pso basic", acviewpreview,, "[empid]=" & "'" &
me![lstempid].column(0) & "'"
or
Docmd.openreport "pso basic", acviewpreview,, "[empid]=" &
me![lstempid].column(0)

Peter
 
Thank you peter that did the job but there is one small problem
if i try to selected more then one person it will only accept the one record
for the report how do you set it up to keep going till all the selected name
are done.


thanks again for you help


Peter Kaufman said:
Try:
Docmd.openreport "pso basic", acviewpreview,, "[empid]=" & "'" &
me![lstempid].column(0) & "'"
or
Docmd.openreport "pso basic", acviewpreview,, "[empid]=" &
me![lstempid].column(0)

Peter


I have a report called PSO Basic and i need the user to choose who the
report is on from a list box that includes personal.

Docmd.openreport "pso basic", acviewpreview,, "[empid]=" & "'" &
me![lstempid] & "'"

when I run the command I just get a blank line on the report.
where did I go wrong.

the list box contains 4 parts of a table on empy. They are empid, Name,
Init, Dept.
Empid is the one linked. the bound is set at 1

Thanks for any help
 
Hi Michael,

Glad you got it working.

It sounds like you need to loop thru the listbox finding all the
selected items. I think that is a little tricky using a column other
than the bound one. Have a look at:

http://makeashorterlink.com/?X64F51A97

Peter


Thank you peter that did the job but there is one small problem
if i try to selected more then one person it will only accept the one record
for the report how do you set it up to keep going till all the selected name
are done.


thanks again for you help


Peter Kaufman said:
Try:
Docmd.openreport "pso basic", acviewpreview,, "[empid]=" & "'" &
me![lstempid].column(0) & "'"
or
Docmd.openreport "pso basic", acviewpreview,, "[empid]=" &
me![lstempid].column(0)

Peter


I have a report called PSO Basic and i need the user to choose who the
report is on from a list box that includes personal.

Docmd.openreport "pso basic", acviewpreview,, "[empid]=" & "'" &
me![lstempid] & "'"

when I run the command I just get a blank line on the report.
where did I go wrong.

the list box contains 4 parts of a table on empy. They are empid, Name,
Init, Dept.
Empid is the one linked. the bound is set at 1

Thanks for any help
 
Back
Top