473,396 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Split the Memo field

Roy
I have a table with two fields. I wish to separate all the data in
one field and keep it listed against the information in the other
field. The information within the field TicketStatus, I wish to
separate is
separated with a small box, meaning a tab .There can be up
to twenty separate bits of info in the field.
I would like to get a table in which the information in the field I
am trying to separate (TicketStatus),is individually listed against
the info in the
other field. I am using Access 2000

eg of entry in TicketStatus:
02/01/2007 14:23:35 EDT: Problem Closed. tab 01/04/2007 09:05:31 EDT:
PD Report Published.
tab 01/03/2007 10:37:38 EDT: Problem opened. tab 01/03/2007 12:00:24
EDT: Problem updated.

I have written the tab for illustartion purposes,but you will
understand the same.

Any Suggestions?

Roy

Mar 4 '07 #1
1 3604
On Mar 4, 9:59 am, "Roy" <praish1...@yahoo.comwrote:
I have a table with two fields. I wish to separate all the data in
one field and keep it listed against the information in the other
field. The information within the field TicketStatus, I wish to
separate is
separated with a small box, meaning a tab .There can be up
to twenty separate bits of info in the field.
I would like to get a table in which the information in the field I
am trying to separate (TicketStatus),is individually listed against
the info in the
other field. I am using Access 2000

eg of entry in TicketStatus:
02/01/2007 14:23:35 EDT: Problem Closed. tab 01/04/2007 09:05:31 EDT:
PD Report Published.
tab 01/03/2007 10:37:38 EDT: Problem opened. tab 01/03/2007 12:00:24
EDT: Problem updated.

I have written the tab for illustartion purposes,but you will
understand the same.

Any Suggestions?

Roy
We'll call your existing table [tblOld] and assume its structure is:

TicketNo: Long Integer
TicketStatus: Memo

Create a new table called [tblNew] with the following structure:

TicketNo: Long Integer
TicketStatusItem: Text(255)

The following code will split the memo field into individual items:

Sub SplitMemo()
Dim rstOld As DAO.Recordset, rstNew As DAO.Recordset
Dim items As Variant, thing As Variant

Set rstOld = CurrentDb.OpenRecordset( _
"SELECT TicketNo, TicketStatus FROM tblOld", _
dbOpenSnapshot)

Set rstNew = CurrentDb.OpenRecordset( _
"tblNew", _
dbOpenTable)

Do While Not rstOld.EOF
items = Split(rstOld!TicketStatus, vbTab, , vbTextCompare)
For Each thing In items
rstNew.AddNew
rstNew!TicketNo = rstOld!TicketNo
rstNew!TicketStatusItem = thing
rstNew.Update
Next
rstOld.MoveNext
Loop

rstNew.Close
Set rstNew = Nothing
rstOld.Close
Set rstOld = Nothing
End Sub

Mar 4 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Shyguy | last post by:
I want to create two buttons on a form. One would allow the user to Copy the contents of the current records memo field, the other would allow them to print. I set up a report based on the memo...
2
by: Jeremy | last post by:
I have a pretty straightforward database that is designed to record free-form information about products (date, source and a memo field). This is searched and updated via a form. For new records,...
3
by: GorDon | last post by:
Hi, I have a report based on a query. The query grabs a memo field from my main table, yet when I display the memo field in the report it truncates the memo field (the field needs to hold more...
9
by: RMC | last post by:
Hello, I'm looking for a way to parse/format a memo field within a report. The Access 2000 database (application) has an equipment table that holds a memo field. Within the report, the memo...
3
by: Roy | last post by:
Hi All, I have a table in A2K application.I get a memo field via download from a .csv file.The contents are as below: field name is TicketStatus, For example,a single ticket,TicketID 12345 ...
4
by: kaplan.gillian | last post by:
Hi everyone, I currently have an Access database that includes quite a few long memo fields. When I create a report of my data, Access does not allow the memo fields to be split with the page...
2
by: Roger | last post by:
I've got two tables in sql2005 which have an 'ntext' field when I linked the first table in access97 last week using an odbc data source the access-field type was 'memo' when I link the 2nd...
10
by: ARC | last post by:
This is mainly a speed question. In this example: I have a QuotesHdr table that has a few memo fields. If these memo fields are used extensively by some users, and if their are a large number of...
2
by: AdrianJ1980 | last post by:
Hi, I apologise for not providing a code basis for my question, but i really am stuck. Does anyone know how i can split a memo field, such as below, into separate records. (The data comes from...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.