By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,209 Members | 1,100 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,209 IT Pros & Developers. It's quick & easy.

Finding data in a memo field

P: n/a
I have a linked table (Access 2003) to an Outlook inbox. The body of
the e-mail messages are in a memo field. My problem is that I need to
"read" the memo and find data on certain lines.

The memo will look something like this:

Order: J123451
Placed By: Joe.systems,daily

Order: J123452
Placed By: John.systems,daily

Order: J123453
Placed By: Tom.engineering,daily

Order: J123454
Placed By: Joe.systems,weekly

I need to find each order number and create a Orders record (J12345)
in the
Orders table and write the detail to a OrdersDetail table that has a
"lookup
field" to the Orders Table.

How do I go about reading through the memo and finding/using the data
that I want?
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Helgardh wrote:
I have a linked table (Access 2003) to an Outlook inbox. The body of
the e-mail messages are in a memo field. My problem is that I need to
"read" the memo and find data on certain lines.

The memo will look something like this:

Order: J123451
Placed By: Joe.systems,daily

Order: J123452
Placed By: John.systems,daily

Order: J123453
Placed By: Tom.engineering,daily

Order: J123454
Placed By: Joe.systems,weekly

I need to find each order number and create a Orders record (J12345)
in the
Orders table and write the detail to a OrdersDetail table that has a
"lookup
field" to the Orders Table.

How do I go about reading through the memo and finding/using the data
that I want?


I'd store the memo to a variable. Then I'd search for "Order:" Then
I'd Mid() it. Then I'd search for chr(10) + chr(13). Then I'd search
for the next "Order:". Anything between the two is specific to an
order. THen I'd move to the next group. If the second search returns a
0, then you are at the end of the list.

Ex:
S = Memo
Do while True
Start = Instr(s,"Order:")
If start > 0 then
'remove everthing up to and including "Order: "
s = Mid(s,Start + 6)

'find where the next "Order: " exists
End = Instr(s,"Order:")

'this is the string from the order# to next order#
'IOW, getting all data between "Order#" and "Order#"
If End > 0 then
ProcessOrder = Left(s,End-1)
Else
'at the end of the list
ProcessOrder = s
ENdif

...process order by parsing out the order info. Ex:
'Order: J123451
'Placed By: Joe.systems,daily

'now move to the next "Order: "
If End > 0 then
s = Mid(s,End)
Endif
Else
Exit DO
Endif
Loop

Nov 13 '05 #2

P: n/a
he******@nha.co.za (Helgardh) wrote in message news:<a3**************************@posting.google. com>...
I have a linked table (Access 2003) to an Outlook inbox. The body of
the e-mail messages are in a memo field. My problem is that I need to
"read" the memo and find data on certain lines.

The memo will look something like this:

Order: J123451
Placed By: Joe.systems,daily

Order: J123452
Placed By: John.systems,daily

Order: J123453
Placed By: Tom.engineering,daily

Order: J123454
Placed By: Joe.systems,weekly

I need to find each order number and create a Orders record (J12345)
in the
Orders table and write the detail to a OrdersDetail table that has a
"lookup
field" to the Orders Table.

How do I go about reading through the memo and finding/using the data
that I want?

My guess is you could read the content of the message into a string
variable and then parse it out, then write that data to your table.
Don't think it's going to be that easy.
Nov 13 '05 #3

P: n/a
Thank you Salad!
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.