3 hours ago: Our file storage provider is running maintenance today. If any videos don't load, wait a minute, refresh the page, and try again. Sorry for any inconvenience.  Dismiss
Computer Learning Zone CLZ Access Excel Word Windows

Learning starts with failure; the first failure is the beginning of education.

-John Hersey
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
Home > Courses > Access > Seminars > Email > Lessons >
Back to Email Seminar Lessons    Comments List
Lesson26 Collecting Data Email Upload Images   Link   Email  
Travis Hagen       
18 months ago
I have a webform that returns an email similar to the example though the data is on the next line instead of after. Is there a way to retrieve that data with small changes to the code?  Thanks.


Tom Johnson

555 12th S
Scott Axton            
18 months ago
Access Developer 30, which I see you have, discusses File I/O and converting your data for import more in depth.

Without seeing the code you have currently we can't really advise how to tweak it to do what you need.  You probably need to post a snippet of your code or screen shots of same.
Travis Hagen       
18 months ago
Hi Scott.  Thanks for the reply.  I'll check out Developer 30. This is 100% Richards code and I haven't tried to use it yet.  It's purpose is to Parse data from an incoming emails table, in my case to collect new customer webform data. He searched for a string then selected the following data on that same line. I want to search for a string then select the data on the following line.   Here is his code:

Private Function CheckForString(inS As String, inLookFor As String) As String

    Dim P As Integer
    Dim S As String, LookFor As String
    S = inS
    LookFor = inLookFor
    P = InStr(S, LookFor)
    If P <> 0 Then
        S = Trim(Right(S, Len(S) - P - Len(LookFor) + 1))
        S = ""
    End If
    CheckForString = S

End Function

Private Sub Command1_Click()

    Dim DB As Database
    Dim RS As Recordset, RSout As Recordset
    Dim MsgBody As String
    Dim FF
    Dim OneLine As String, S As String, P As Integer
    Set DB = CurrentDb()
    Set RS = DB.OpenRecordset("IncomingT", dbOpenDynaset)
    Set RSout = DB.OpenRecordset("ResponseT", dbOpenDynaset)
    FF = FreeFile
    While Not RS.EOF
        MsgBody = RS!MsgBody
        Open "C:\Users\Richard\Desktop\TempFile.TXT" For Output As #FF
        Print #FF, MsgBody
        Close #FF
        Open "C:\Users\Richard\Desktop\TempFile.TXT" For Input As #FF
        While Not EOF(FF)
            Line Input #FF, OneLine
            S = CheckForString(OneLine, "First Name:")
            If S <> "" Then RSout!FirstName = S
            S = CheckForString(OneLine, "Last Name:")
            If S <> "" Then RSout!LastName = S
            S = CheckForString(OneLine, "Address:")
            If S <> "" Then RSout!Address = S
            S = CheckForString(OneLine, "City:")
            If S <> "" Then RSout!City = S
            S = CheckForString(OneLine, "State:")
            If S <> "" Then RSout!State = S
            S = CheckForString(OneLine, "ZIP:")
            If S <> "" Then RSout!ZIP = S
            S = CheckForString(OneLine, "Phone:")
            If S <> "" Then RSout!Phone = S
        Close #FF
    Set RS = Nothing
    Set DB = Nothing
    MsgBox "Done."
    DoCmd.SetWarnings False
    DoCmd.RunSQL "DELETE * FROM IncomingT"
    DoCmd.SetWarnings True

End Sub

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Email Seminar Lessons.


The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.

Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
My Account
My Courses
Lost Password
Student Databases
Change Email
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Customer Support
Web Site Tour
Consulting Services
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Video Tutorials
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Terms of Sale
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 7/14/2024 9:46:05 AM. PLT: 1s