Form Coding Help

  • Thread starter Thread starter BaWork
  • Start date Start date
B

BaWork

I have the following code:

*******************************************

Private Sub cmd_save_report_Click()
On Error GoTo Err_cmd_save_report_Click

Dim stDocName As String

stDocName = "rpt_resume"
DoCmd.OutputTo acReport, stDocName, acFormatSNP

Exit_cmd_save_report_Click:
Exit Sub

Err_cmd_save_report_Click:
MsgBox Err.Description
Resume Exit_cmd_save_report_Click

End Sub

*******************************************

I would like to name the saved file something different "rpt_resume". I
would like to name the file using a variable from the form. The
variable has the name of "full_name". Ideally, I would like to name the
file:

full_name & "_resume"

What should the code be to call the variable and then code the complete
file name?

Thanks.

Brett
 
Brett,

Try this:

Private Sub cmd_save_report_Click()
On Error GoTo Err_cmd_save_report_Click

Dim stDocName As String

stDocName = Me!full_name & " Resume"
DoCmd.OutputTo acReport, stDocName, acFormatSNP

Exit_cmd_save_report_Click:
Exit Sub

Err_cmd_save_report_Click:
MsgBox Err.Description
Resume Exit_cmd_save_report_Click

End Sub

TomU
 
Back
Top