Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / October 2007

Tip: Looking for answers? Try searching our database.

Rename caption using code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
m stroup - 22 Oct 2007 16:03 GMT
I am using the following which is called in a cmdBtn sub
Private Sub SendEmail()

On Error GoTo Err_SendEmail

   Dim strEmail1 As String
   Dim strMailSubject As String
   Dim strMsg As String
   Dim strDoc As String
   strDoc = "Flight_Summary_for_Flight_" & FlightID.Value
   strEmail1 = "xxx@xxx.xxx" & vbNullString
   strMailSubject = "Flight Summary for Flight " & FlightID.Value
   strMsg = "I am attaching the latest Flight Summary Report."
   DoCmd.Rename strDoc, acReport, "rptForEmail"
   DoCmd.SendObject acSendReport, "Flight_Summary_for_Flight_" &            
      FlightID.Value, acFormatSNP, strEmail1, , , strMailSubject, strMsg,
True
   DoCmd.Rename "rptForEmail", acReport, strDoc

Exit_SendEmail:
   Exit Sub
   
Err_SendEmail:
   MsgBox Err.Description
   Resume Exit_SendEmail

End Sub

This does indeed change the name of the report, but does not change the name
in the email attachment.  So I am thinking I need to change the caption, but
can't find the right syntax.
   
Teach me to fish!  Thanks for the help.
Pax, M
Jeff Boyce - 22 Oct 2007 23:03 GMT
Have you looked into the .Caption property?  (check Access HELP)

Regards

Jeff Boyce
Microsoft Office/Access MVP

>I am using the following which is called in a cmdBtn sub
> Private Sub SendEmail()
[quoted text clipped - 32 lines]
> Teach me to fish!  Thanks for the help.
> Pax, M
m stroup - 23 Oct 2007 17:26 GMT
I had looked there before posting.  But, I did go back at your suggestion.  
My problem was I was not opening the report before trying to change the
caption.  Once that was changed, it worked great.  Thanks for making me think!
Signature

Teach me to fish!  Thanks for the help.
Pax, M

> Have you looked into the .Caption property?  (check Access HELP)
>
[quoted text clipped - 39 lines]
> > Teach me to fish!  Thanks for the help.
> > Pax, M
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.