Hi
I have got to the Grrrrr:banghead: stage. I have been constructing an import routine for emails. I have worked through all the code to get the email to table etc. But I am trying to get my DB to “Read & Match ” two DB fields that will appear in the imported email Subject & or Body
1.[JobID] is always formatted in the email as JID00001 so made up some InStr code. Below is an example of the piece to read the email Body and place the value in the frm.
2. [SupplierConfirmationNo] unfortunately this field name unlike the JID will never appear in the email and it has no set formatting apart from the field’s value as a hole. As the [SupplierConfirmationNo] value is already in the DB can anybody suggest a way how can I get my DB to match them up so I can put the value in the frm like the JID
I have attached a copy of the DB with sample emails containing matching [JobID] & [SupplierConfirmationNo] examples
Hope this make some sense
Thanks
Stewart
I have got to the Grrrrr:banghead: stage. I have been constructing an import routine for emails. I have worked through all the code to get the email to table etc. But I am trying to get my DB to “Read & Match ” two DB fields that will appear in the imported email Subject & or Body
1.[JobID] is always formatted in the email as JID00001 so made up some InStr code. Below is an example of the piece to read the email Body and place the value in the frm.
2. [SupplierConfirmationNo] unfortunately this field name unlike the JID will never appear in the email and it has no set formatting apart from the field’s value as a hole. As the [SupplierConfirmationNo] value is already in the DB can anybody suggest a way how can I get my DB to match them up so I can put the value in the frm like the JID
I have attached a copy of the DB with sample emails containing matching [JobID] & [SupplierConfirmationNo] examples
Hope this make some sense
Thanks
Stewart
PHP:
Dim aInput() As String
Dim strLine As String
Dim strVar() As String
Dim a As Integer
Dim strTemp As String
aInput = Split(Me.Body, vbCrLf)
For a = 0 To UBound(aInput) - 1
If Len(Nz(aInput(a))) > 1 Then
strLine = aInput(a)
If InStr(strLine, "JID") Then
strTemp = Trim(Mid(strLine, InStr(strLine, "JID"), 8)) & " "
strVar = Split(strLine, "JID")
strTemp = Trim(Left(strTemp, InStr(strTemp, " ") - 1))
If Not strTemp = "" Then Me.txtMatched JID = strTemp
End If
End If
Next a
Me.Refresh
End Sub