output file name - errors

C

carolm

I'm trying to use this:
="c:\" & [Reports]![PINN_AntibioticCharting by PT#]![PAT_NUM] & ".snp". I'm
running report PINN_AntibioticCharting by PT# which I'm trying to output to a
snapshot with a unique file name related to the patient number that is
entered via a parameter query. When the macro runs it keeps erroring
indicating unable to find that report - not open or mispelled. I'm using
access 2000.

I've also tried using ="c:\" & [Tables]![tbl_PINN_PT#forQueries]![PT#] &
".snp" and errors indicating can't find that table.
 
C

Clifford Bass

Hi Carol,

At the time that the macro is constructing the file name, it would need
to have access to the field on the report. Do you have the report open
before you try to export it as a snapshot? It may make more sense to run
this from a form where the user enters the patient number into a field. Then
you can reference the form's field both from the report's record source query
and from the code that does the export.

Clifford Bass
 
S

Steve Schapel

Carol,

I agree with Clifford. Just to clarify, I think he is referring to using an
unbound control on a form, for the entry of the patient number.

I think most Access users pretty soon give up on parameter queries.

By the way, I should also say that it is a bad idea to use a # as part of
the name of a field or control or database object.
 
C

carolm

Good points. I will try a form and also remove # from filenames.

Steve Schapel said:
Carol,

I agree with Clifford. Just to clarify, I think he is referring to using an
unbound control on a form, for the entry of the patient number.

I think most Access users pretty soon give up on parameter queries.

By the way, I should also say that it is a bad idea to use a # as part of
the name of a field or control or database object.

--
Steve Schapel, Microsoft Access MVP

carolm said:
I'm trying to use this:
="c:\" & [Reports]![PINN_AntibioticCharting by PT#]![PAT_NUM] & ".snp".
I'm
running report PINN_AntibioticCharting by PT# which I'm trying to output
to a
snapshot with a unique file name related to the patient number that is
entered via a parameter query. When the macro runs it keeps erroring
indicating unable to find that report - not open or mispelled. I'm using
access 2000.

I've also tried using ="c:\" & [Tables]![tbl_PINN_PT#forQueries]![PT#] &
".snp" and errors indicating can't find that table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top