Getting output filname from Form

  • Thread starter Thread starter Baard Dahl
  • Start date Start date
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
 
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>
 
Back
Top