Getting output filname from Form

B

Baard Dahl

Hallo,

I have the following code

On Error Resume Next

Dim stDocName As String

stDocName = "Revenue"
DoCmd.OutputTo acReport, stDocName, acFormatXLS,
Headline

Where 'Headline' is a text box in a form. I want the
output file to be called 'Whatever is in the textbox.xls',
but I cant figure out how to get .xls attached to the
string from the textbox.

Help would be greatly appreaciated.

Baard
 
J

Jeff Boyce

Baard

If you are trying to refer to the contents of a form, the form must be open,
and the expression that points to it looks like:

Forms!YourFormName!YourControlName

(actual syntax may vary).

Good luck

Jeff Boyce
<Access MVP>
 

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