Hi moke
many many thanks for all of your guidance on this project which is now working as it should.
Thanks again

Can you give me a quick guide on what I should do with the following structure where the first 2 lines are Blank.
From: Elise Kelman
Email Address:
Subject: [Open Course Individual Booking - Elementary Food Hygiene - 27/09/2017]
Message Body:
Name: Elise Kelman
Email Address:
km@gmail.com<mailto:km@gmail.com>
Phone Number: 023456081614
Address:
4 Woodburn Road
Edinburgh
EH11 4DT
Course Title: Elementary Food Hygiene
Course Date: 27th September 2017
Additional Comments: dietary requirements etc.
--
This e-mail was sent from a contact form on Training For Care (
http://www.tfcscotland.org.uk.gridhosted.co.uk)
I modified the Module as shown below but it constantly gives me the error Type miss-match ??
Any help appreciated:-
The Modified Module is as shown below:-
Public Function Replacements2(varString As String) As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSql As String
Dim strRep As Variant
Dim strWrite As Variant
Dim RepString As String
Dim i As Integer
Dim strOut As String
strOut = Replace(varString, "From:", "", "EMail Address:", "") 'remove "From:" from the 0 position
'string of items to replace with |
RepString = "Subject:,Message Body:,Name:,Email Address:,Phone Number:,Address:,Course Title:,Course Date:,Additional Comments:,--"
strRep = Split(RepString, ",")
strOut = Replace(Replace(strOut, Chr(10), ""), Chr(13), " ") 'remove the carraige returns and line feeds
'loop throught the string and make the replacements
For i = 0 To UBound(strRep)
strOut = Replace(strOut, strRep(i), "|")
Next i
'Debug.Print strOut 'jjed for testing
strWrite = Split(strOut, "|") 'split the resulting string by the | character
strSql = "select * from TableIndividual1 where id = 0"
Set db = CurrentDb()
Set rs = db.OpenRecordset(strSql)
'write the values to the table by there position in the array
rs.AddNew
rs!From = strWrite(0)
rs!EmailAddress = strWrite(1)
rs!Subject = strWrite(2)
rs!MessageBody = strWrite(3)
rs!Name = strWrite(4)
rs!EmailAddress = strWrite(5)
rs!PhoneNumber = strWrite(6)
rs!Address = strWrite(7)
rs!CourseTitle = strWrite(8)
rs!CourseDate = strWrite(9)
rs!AdditionalComments = strWrite(10)
rs.Update
MyExit:
rs.Close
Set rs = Nothing
Set db = Nothing
End Function