Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Send email from data access form - Subject Problem

Discussion in 'Information Technology' started by Michael J. Earl, Nov 6, 2005.

  1. Michael J. Earl

    Michael J. Earl
    Expand Collapse
    Guest

    I am trying to create an email send from a data access form.

    No problem to enter the address:- just enter mailto:xyx@xxxx.com in the
    email address field.

    No problem to display required text in the Hyperlink field on the form -
    Hyperlink.ControlSource: Expr2: "email Web Application Job No " & [JobCode]
    (where JobCode is another field (integer) on the form) eg. "email Web
    Application Job No 1333" ......

    But how can I get the same string to concatenate and display correctly in
    the "Subject" Field of the Hyperlink / new email, without resorting to
    separate script?
    It looks like ought to be possible but I just cannot make it work.
    Any ideas?
    If it is not possible - has anybody got a code snippet I could insert?

    Help please

    mike
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Why This Sikh Cartoonist Is Sending A Postcard To Trump Every Day Breaking News Mar 23, 2016
    UK Statue of turbaned Sikh fighter pilot unveiled in Gravesend Breaking News Nov 29, 2014
    Leisure Appropriate to send flowers to a friend's ill Mother in India? Business, Lifestyle & Leisure Jun 6, 2013
    USA Preet Bharara Sends a Message to Wall Street about Insider Trading Breaking News May 18, 2011
    USA U.S. Sends Warning to People Named in Cable Leaks Breaking News Jan 7, 2011

  3. Andy Couch - UK Access User Group

    Guest

    Here is an example of a code snippet, you will need to include the outlook
    refernce library.

    The biggest problem with linking e-mails to outlook, are the various changes
    Microsoft keep making to outlook in service packs, which tends to make the
    whole process more difficult.

    The following is fairly basic but should get you started.

    Sub Mail_Send(Subject As String, Body As String, ToAddress As String,
    DatabaseFile As String)
    Dim objOL As Outlook.Application
    Dim Trymail As Integer
    Trymail = 0
    RetryMail:
    Trymail = Trymail + 1
    On Error Resume Next
    Set objOL = GetObject(, "Outlook.Application")
    If Err.Number <> 0 Then
    MsgBox "Start Your EMail System The Press OK", vbInformation, "EMail
    Not Running"
    If Trymail > 5 Then
    MsgBox "Aborting Operation Unable To Start E-Mail"
    Exit Sub
    End If
    GoTo RetryMail
    End If
    On Error GoTo 0

    Dim ObjFolder As Outlook.MAPIFolder
    Dim objNameSpace As Outlook.NameSpace
    Set objNameSpace = objOL.GetNamespace("MAPI")
    Call objNameSpace.Logon("Microsoft Outlook", "", False, True)
    ' Set ObjFolder = objNameSpace.GetDefaultFolder(olFolderInbox)
    ' ObjFolder.Display
    Set objMail = objOL.CreateItem(olMailItem)
    objMail.Subject = Subject
    objMail.Body = Body
    objMail.To = ToAddress

    objMail.Display

    Set objOL = Nothing
    End Sub

    Hope this helps.
     
  4. Michael J. Earl

    Michael J. Earl
    Expand Collapse
    Guest

    Andy,

    Thanks for the reply and code snippet....

    But are you saying that I definitely can't set the subject in Href using
    field information
    eg.mailto:dfdfdhdhh@com?Subject=DataAccesssPages!MyDataAccessPage!Hypperlink
    ..text?

    Please confirm

    Mike

    "Andy Couch - UK Access User Group"
    <AndyCouchUKAccessUserGroup@discussions.microsoft.com> wrote in message
    news:74AE0FF9-8012-4AAF-9EDF-567CBBAA13E3@microsoft.com...
    > Here is an example of a code snippet, you will need to include the outlook
    > refernce library.
    >
    > The biggest problem with linking e-mails to outlook, are the various

    changes
    > Microsoft keep making to outlook in service packs, which tends to make the
    > whole process more difficult.
    >
    > The following is fairly basic but should get you started.
    >
    > Sub Mail_Send(Subject As String, Body As String, ToAddress As String,
    > DatabaseFile As String)
    > Dim objOL As Outlook.Application
    > Dim Trymail As Integer
    > Trymail = 0
    > RetryMail:
    > Trymail = Trymail + 1
    > On Error Resume Next
    > Set objOL = GetObject(, "Outlook.Application")
    > If Err.Number <> 0 Then
    > MsgBox "Start Your EMail System The Press OK", vbInformation,

    "EMail
    > Not Running"
    > If Trymail > 5 Then
    > MsgBox "Aborting Operation Unable To Start E-Mail"
    > Exit Sub
    > End If
    > GoTo RetryMail
    > End If
    > On Error GoTo 0
    >
    > Dim ObjFolder As Outlook.MAPIFolder
    > Dim objNameSpace As Outlook.NameSpace
    > Set objNameSpace = objOL.GetNamespace("MAPI")
    > Call objNameSpace.Logon("Microsoft Outlook", "", False, True)
    > ' Set ObjFolder = objNameSpace.GetDefaultFolder(olFolderInbox)
    > ' ObjFolder.Display
    > Set objMail = objOL.CreateItem(olMailItem)
    > objMail.Subject = Subject
    > objMail.Body = Body
    > objMail.To = ToAddress
    >
    > objMail.Display
    >
    > Set objOL = Nothing
    > End Sub
    >
    > Hope this helps.
     
  5. Andy Couch - UK Access User Group

    Guest

    No I am not saying that you definitely can't set the subject in Href using
    field information, but you could try setting it via some code if you are
    having problems with your current approach.

    Hope this gives you another avenue to investigate.

    "Michael J. Earl" wrote:

    > Andy,
    >
    > Thanks for the reply and code snippet....
    >
    > But are you saying that I definitely can't set the subject in Href using
    > field information
    > eg.mailto:dfdfdhdhh@com?Subject=DataAccesssPages!MyDataAccessPage!Hypperlink
    > ..text?
    >
    > Please confirm
    >
    > Mike
    >
     
  6. Michael J. Earl

    Michael J. Earl
    Expand Collapse
    Guest

    Looks like Href and Standard Hyperlink field settings can only parse
    resolved, concatenated strings and one cannot use VB in Data Access Pages.
    Instead one must use scripting or HTML and I'm totally out of my depth in
    both.
    I found some HTML code on the Knowledge Base - but I have to admit I don't
    know where to start - I don't even know whereabouts in the HTML to insert
    it.
    So I think I'm stuck.
    Put together with some unresolved e-commerce dynamic web site problems with
    NetObjects Fusion 8, it's not been the most productive weekend.

    But as they:- "If you have been, thanks for listening."

    Mike


    "Andy Couch - UK Access User Group"
    <AndyCouchUKAccessUserGroup@discussions.microsoft.com> wrote in message
    news:1E8B3B89-7400-4DEF-8C72-46BC3583795E@microsoft.com...
    > No I am not saying that you definitely can't set the subject in Href using
    > field information, but you could try setting it via some code if you are
    > having problems with your current approach.
    >
    > Hope this gives you another avenue to investigate.
    >
    > "Michael J. Earl" wrote:
    >
    > > Andy,
    > >
    > > Thanks for the reply and code snippet....
    > >
    > > But are you saying that I definitely can't set the subject in Href using
    > > field information
    > >

    eg.mailto:dfdfdhdhh@com?Subject=DataAccesssPages!MyDataAccessPage!Hypperlink
    > > ..text?
    > >
    > > Please confirm
    > >
    > > Mike
    > >

    >
     
  7. Andy Couch - UK Access User Group

    Guest

    Yea I probably directed you off in the wrong direction here. The kind of code
    that I sent you would work in a standard access form, or work in ASP, or you
    could get something similar to work in ASP.NET. I have a number of
    applications which use ASP pages and Access databases for sophisticated
    e-mailing, but I never use Data Access Pages, and would not recommend them
    unless you have a very simple requirement, then they are too restrictive.

    I remember seeing a sophisticated presentation on using Data Access pages,
    and I kept thinking why bother, when their are much better technologies to
    solve these problems.

    My advise would be to use either .NET or standard ASP to achive your
    functionality (as I presume you want it to work through a browser).

    Sorry if I miss-directed you here.

    "Michael J. Earl" wrote:

    > Looks like Href and Standard Hyperlink field settings can only parse
    > resolved, concatenated strings and one cannot use VB in Data Access Pages.
    > Instead one must use scripting or HTML and I'm totally out of my depth in
    > both.
    > I found some HTML code on the Knowledge Base - but I have to admit I don't
    > know where to start - I don't even know whereabouts in the HTML to insert
    > it.
    > So I think I'm stuck.
    > Put together with some unresolved e-commerce dynamic web site problems with
    > NetObjects Fusion 8, it's not been the most productive weekend.
    >
    > But as they:- "If you have been, thanks for listening."
    >
    > Mike
    >
    >
    > "Andy Couch - UK Access User Group"
    > <AndyCouchUKAccessUserGroup@discussions.microsoft.com> wrote in message
    > news:1E8B3B89-7400-4DEF-8C72-46BC3583795E@microsoft.com...
    > > No I am not saying that you definitely can't set the subject in Href using
    > > field information, but you could try setting it via some code if you are
    > > having problems with your current approach.
    > >
    > > Hope this gives you another avenue to investigate.
    > >
    > > "Michael J. Earl" wrote:
    > >
    > > > Andy,
    > > >
    > > > Thanks for the reply and code snippet....
    > > >
    > > > But are you saying that I definitely can't set the subject in Href using
    > > > field information
    > > >

    > eg.mailto:dfdfdhdhh@com?Subject=DataAccesssPages!MyDataAccessPage!Hypperlink
    > > > ..text?
    > > >
    > > > Please confirm
    > > >
    > > > Mike
    > > >

    > >

    >
    >
    >
     

Share This Page