Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21

Sum Of Report Records

  1. #16
    DMT Dave is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    65
    Hi ridders52, i must still be doing something wrong! i will paste function + current email button procedure and the function from module..

    email address on the print scr image has gone on a new line feed and still ins't hyperlink or clickable to email return!

    Code:
    Public Function GetEMAdd() As String
    
    GetEMAdd = DLookup("EmailAdd", "tblSignatures", "[IDNumber] = Forms!Form1!txtIndexNo")
    
    
    
    
    
    
    End Function
    Code:
    Dim MyApp As Outlook.ApplicationDim MyItem As Outlook.MailItem
    Dim BodyMessage, Orders, SigString, Signature As String
    Dim MySig As String
    Dim EMAdd As String
    
    
    
    
    Signature = "<P>Unit 123,</P>" & vbNewLine & _
    "<P>Someplace,</P>" & vbNewLine & _
    "<P>Somewhere</P>" & vbNewLine & _
    "<P>Tel: 1234-56789</P>" & vbNewLine & _
    "E-Mail:" & " " & "</P>" & GetEMAdd & "</P>"
    
    
    Set MyApp = CreateObject("Outlook.application")
    Set MyItem = MyApp.CreateItem(olMailItem)
    BodyMessage = "THIS IS A TEST EMAIL FROM DM" & Chr(10) & Chr(10) & _
    "<P><img border =0 hspace=0 alt='' src='C:\Users\David\Desktop\DMT\EmailLogo.jpg' align=baseline></P>"
    
    
    With MyItem
    'Signature = MyItem.HTMLBody
    .To = "dave@dmoses.co.uk"
    .Subject = "TEST MAIL FROM DM"
    Debug.Print BodyMessage
    MyItem.HTMLBody = BodyMessage & Chr(10) & _
    Signature
    Debug.Print .HTMLBody
    .Display
    End With
    Click image for larger version. 

Name:	Signature.jpg 
Views:	10 
Size:	77.7 KB 
ID:	34403

  2. #17
    ridders52's Avatar
    ridders52 is offline Voodoo Is Practised
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    2,476
    You've messed up the email line
    I've successfully tested both of the following:

    Code:
    Signature = "<P>Unit 123,</P>" & vbNewLine & _"<P>Someplace,</P>" & vbNewLine & _
    "<P>Somewhere</P>" & vbNewLine & _
    "<P>Tel: 1234-56789</P>" & vbNewLine & _
    "<P>mailto: " & GetEMAdd() & "</P>"
    OR probably better for your purposes

    Signature = "<P>Unit 123,</P>" & vbNewLine & _
    "<P>Someplace,</P>" & vbNewLine & _
    "<P>Somewhere</P>" & vbNewLine & _
    "<P>Tel: 1234-56789</P>" & vbNewLine & _
    "<P>Email: " & GetEMAdd() & "</P>"

    This is the EXACT code I've just used in a test email:
    Code:
    aHTMLBody = "This is a <FONT size=5><FONT color=#800000><B>TEST message</B><FONT size=3>.<FONT color=#000000>" & _
        " to check <I>HTML email</I> with no attachments from the <B><I>" & GetProgramName() & "</B></I> program" & _
        " <P><IMG border=0 hspace=0 alt='' src='file://G:/Programs/MendipDataSystems/CommonFiles/SDA/Images/SDAUpdater1.gif' align=baseline</P>" & _
        "<P>Email: " & GetCurrentTeacherEMail() & "</P>"
    Result (using a fictitious email address):
    Click image for larger version. 

Name:	Capture.PNG 
Views:	9 
Size:	28.8 KB 
ID:	34404
    Last edited by ridders52; 06-12-2018 at 04:25 AM.
    Colin (Mendip Data Systems), Website, email
    If this has helped, please click the star button and leave a comment

  3. #18
    DMT Dave is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    65
    Hi ridders52, i have copied your code directly to mine, it all aligns perfectly, the EMAdd is still plain text unlike yours!, is this a field type setting in the table do you think ?

  4. #19
    DMT Dave is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    65
    Here is another one i am working with, using postcodes and a list based on a query, i am retrieving postcodes and placing them on google maps, works great, is there a method of retrieving the postcodes through a record set ?

    Code:
    Dim mPC, mPC2, mPC3, mPC4, mPC5, mPC6, mPC7, mPC8, mPC9, mPC10, stAppName, MyURL As String
    Dim mQty, mPCQTy As Long
    Dim mPC11, mPC12, mPC13, mPC14, mPC15, mPC16, mPC17, mPC18, mPC19, mPC20 As String
    Dim mStr, mFin As String
    
    
    If Me.cboFolderActions = "Show Planning On Map" Then
    Me.lstPCs.Requery
    mPCQTy = DCount("Postcode", "qryPCCount")
    mQty = mPCQTy
    Select Case mQty
    Case 1
    mPC = Me.lstPCs.Column(1, 1)
    MyURL = "https://www.google.co.uk/maps/place/" & mPC
    OpenFile = Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE " & MyURL, vbMaximizedFocus)
    Case 2
    mPC = Me.lstPCs.Column(1, 1)
    mPC2 = Me.lstPCs.Column(1, 2)
    MyURL = "https://www.google.co.uk/maps/place/" mPC & "/" & mPC2
    OpenFile = Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE " & MyURL, vbMaximizedFocus)
    Case 3
    mPC = Me.lstPCs.Column(1, 1)
    mPC2 = Me.lstPCs.Column(1, 2)
    mPC3 = Me.lstPCs.Column(1, 3)
    MyURL = "https://www.google.co.uk/maps/place/" mPC & "/" & mPC2 & "/" & mPC3
    OpenFile = Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE " & MyURL, vbMaximizedFocus)

  5. #20
    ridders52's Avatar
    ridders52 is offline Voodoo Is Practised
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    2,476
    The datatype for that field is text.
    Memo would probably also be ok as ling as it was plain text format. Not tested
    I NEVER use the hyperlink datatype
    Colin (Mendip Data Systems), Website, email
    If this has helped, please click the star button and leave a comment

  6. #21
    ridders52's Avatar
    ridders52 is offline Voodoo Is Practised
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    2,476
    In response to your off topic question ...
    I suggest you look at my UK postcodes & UK postal address finder apps, both of which do that as well as much more
    The first is free. The latter is a commercial app
    Both are available from my website http://www.mendipdatasystems.co.uk

    By coincidence, I'm releasing an update to the commercial app this week to include nearby place search and geolocation.
    You can also read more about these apps and download early versions from
    https://www.access-programmers.co.uk...d.php?t=295378
    https://www.access-programmers.co.uk...d.php?t=295233
    https://www.access-programmers.co.uk...d.php?t=299932

    HTH
    Colin (Mendip Data Systems), Website, email
    If this has helped, please click the star button and leave a comment

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 02-04-2016, 07:13 AM
  2. Replies: 3
    Last Post: 11-07-2015, 04:08 PM
  3. Replies: 4
    Last Post: 02-12-2015, 03:17 PM
  4. Records w no data on report?
    By wnicole in forum Reports
    Replies: 2
    Last Post: 01-21-2014, 10:13 AM
  5. Replies: 4
    Last Post: 12-13-2010, 04:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums