I'm Stuck with this code! Need some help


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: I'm Stuck with this code! Need some help

  1. #1
    rpalmer4 Guest

    I'm Stuck with this code! Need some help


    Hello,

    My goal is to have the data collected in the user form be sent to me via
    email.

    I craeted a user form to collect end ueser data. My trouble is I'm stuck
    after the msg box code. How do I code this so it will open the users email
    ? also will I have trouble with the last line of code?

    Any Help or suggestions would be welcome!

    Private Sub Registration_Click()
    'prompt user to send registration
    Dim SendYesNo
    SendYesNo = MsgBox("Send This Registration Now?", vbYesNo)
    If SaveYesNo = vbYes Then Hide 'hide only if the user clicked yes

    Dim MSG As String, URL As String
    MSG = MSG & "%0A" & UserForm3.Name
    MSG = MSG & "%0A" & UserForm3.DealershipName
    MSG = MSG & "%0A" & UserForm3.City
    MSG = MSG & "%0A" & UserForm3.State
    MSG = MSG & "%0A" & UserForm3.Zip
    MSG = MSG & "%0A" & UserForm3.UserEmail
    MSG = MSG & "%0A" & UserForm3.DealerEmail
    MSG = MSG & "%0A" & UserForm3.PrincipleName
    MSG = MSG & "%0A" & UserForm3.DealerPhone
    MSG = MSG & "%0A" & UserForm3.Fax
    MSG = MSG & "%0A" & UserForm3.FixedOperation
    MSG = MSG & "%0A" & UserForm3.PsDirector
    MSG = MSG & "%0A" & UserForm3.Sm
    MSG = MSG & "%0A" & UserForm3.Asm
    MSG = MSG & "%0A" & UserForm3.Advisor
    MSG = MSG & "%0A" & UserForm3.Coordinator
    MSG = MSG & "%0A" & UserForm3.Warranty
    MSG = MSG & "%0A" & UserForm3.Service
    MSG = MSG & "%0A" & UserForm3.Dispatch
    MSG = MSG & "%0A" & UserForm3.Foreman
    MSG = MSG & "%0A" & UserForm3.DealerGm
    MSG = MSG & "%0A" & UserForm3.Other
    MSG = MSG & "%0A" & UserForm3.Suggestion
    URL = "mailto:rpalmer4msx@msn.com?subject=Registration?" & body = " & MSG"

    ActiveWorkbook.FollowHyperlink Address:=URL
    End Sub


    Thanks


  2. #2
    Paul Clement Guest

    Re: I'm Stuck with this code! Need some help

    On 14 Aug 2002 22:34:52 -0700, "rpalmer4" <rpalmer4msx@msn.com> wrote:


    Hello,

    My goal is to have the data collected in the user form be sent to me via
    email.

    I craeted a user form to collect end ueser data. My trouble is I'm stuck
    after the msg box code. How do I code this so it will open the users email
    ? also will I have trouble with the last line of code?

    Any Help or suggestions would be welcome!

    Private Sub Registration_Click()
    'prompt user to send registration
    Dim SendYesNo
    SendYesNo = MsgBox("Send This Registration Now?", vbYesNo)
    If SaveYesNo = vbYes Then Hide 'hide only if the user clicked yes

    Dim MSG As String, URL As String
    MSG = MSG & "%0A" & UserForm3.Name
    MSG = MSG & "%0A" & UserForm3.DealershipName
    MSG = MSG & "%0A" & UserForm3.City
    MSG = MSG & "%0A" & UserForm3.State
    MSG = MSG & "%0A" & UserForm3.Zip
    MSG = MSG & "%0A" & UserForm3.UserEmail
    MSG = MSG & "%0A" & UserForm3.DealerEmail
    MSG = MSG & "%0A" & UserForm3.PrincipleName
    MSG = MSG & "%0A" & UserForm3.DealerPhone
    MSG = MSG & "%0A" & UserForm3.Fax
    MSG = MSG & "%0A" & UserForm3.FixedOperation
    MSG = MSG & "%0A" & UserForm3.PsDirector
    MSG = MSG & "%0A" & UserForm3.Sm
    MSG = MSG & "%0A" & UserForm3.Asm
    MSG = MSG & "%0A" & UserForm3.Advisor
    MSG = MSG & "%0A" & UserForm3.Coordinator
    MSG = MSG & "%0A" & UserForm3.Warranty
    MSG = MSG & "%0A" & UserForm3.Service
    MSG = MSG & "%0A" & UserForm3.Dispatch
    MSG = MSG & "%0A" & UserForm3.Foreman
    MSG = MSG & "%0A" & UserForm3.DealerGm
    MSG = MSG & "%0A" & UserForm3.Other
    MSG = MSG & "%0A" & UserForm3.Suggestion
    URL = "mailto:rpalmer4msx@msn.com?subject=Registration?" & body = " & MSG"

    ActiveWorkbook.FollowHyperlink Address:=URL
    End Sub

    Not sure why you are stuck, but one thing I notice is that the URL assignment statement looks to be
    incorrect. Try:

    URL = "mailto:rpalmer4msx@msn.com?subject=Registration&body=" & MSG


    Paul ~~~ pclement@ameritech.net
    Microsoft MVP (Visual Basic)

  3. #3
    Rv! Guest

    Re: I'm Stuck with this code! Need some help


    | Dim SendYesNo
    | SendYesNo = MsgBox("Send This Registration Now?", vbYesNo)
    | If SaveYesNo = vbYes Then Hide 'hide only if the user clicked yes

    Did you just get your variable badly wrong?

    "SendYesNo" changes to "SaveYesNo"

    Robertv!




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center