Form Coding Help

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
 
G

Guest

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
 

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