LRSullivan
New member
- Local time
- Today, 15:46
- Joined
- Mar 5, 2011
- Messages
- 3
I have a table that stores information about documents. Three of the fields in the table are Author, Recipient and Title fields. Some of the data in this table was imported from an Excel spreadsheet which didn't have Author or Recipient fields. Instead, the spreadsheet creator put the Author and Recipient data in the Title field in the following format: "AuthorName/RecipientName Title" (that's two spaces before the title, and it's the only time as far as I can tell that two spaces are used to separate words in the Title field). To complicate matters, there are a few cases where a / is used in the Title field but does not separate AuthorName and RecipientName. To further complicate matters, there are a few cases where RecipientName is a two word name (none that I saw, though, where AuthorName was a two word name). So here's the obvious question:
Is there some code I could use to automate the process of stripping the "AuthorName/RecipientName " off the front of the data in the Title field and updating the Author field with AuthorName and the Recipient name to the Recipient field with RecipientName? I was thinking I could use an intermediate step to strip everything to the left of the double-space and move it to the Recipient field, and then strip everything to the left of the / from the Recipient field and move it to the Author field. Then, of course, I'd have to clean up the / and the double-space. I've been looking at the Left and Left$ functions but I just don't feel like I've quite got a grip on how to use them this way. Any thoughts?
I've attached a small database file with two tables in it with sample records. The first is how stuff looks now, the second is how I'd like it to look. I'd really appreciate any help getting from here to there!
Is there some code I could use to automate the process of stripping the "AuthorName/RecipientName " off the front of the data in the Title field and updating the Author field with AuthorName and the Recipient name to the Recipient field with RecipientName? I was thinking I could use an intermediate step to strip everything to the left of the double-space and move it to the Recipient field, and then strip everything to the left of the / from the Recipient field and move it to the Author field. Then, of course, I'd have to clean up the / and the double-space. I've been looking at the Left and Left$ functions but I just don't feel like I've quite got a grip on how to use them this way. Any thoughts?
I've attached a small database file with two tables in it with sample records. The first is how stuff looks now, the second is how I'd like it to look. I'd really appreciate any help getting from here to there!