If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
code a range of records?
I have a table that contains "header and footer" type records... that is...
the first record in the table is a record that displays "BEGIN BATCH" and various info about all following records up to the "END BATCH" record. In other words, there are "batches" of records denoted by beginning and ending records at each end of the record range. I need to take the value of a field in the "BEGIN" record and assign that value to all records between the "BEGIN" record and the "END" record. There are multiple "batches" in the table that each need to have this value assigned from their respective "BEGIN" record. I do not control the format of this table as it is created by a third party program. I've tried using DLookUp but it doesn't "loop" like I want it to... it basically shifts all values in that field down one record, rather than assigning to all records in the record range. If anyone can help, I would appreciate it. Here is a basic example of the table: BEGIN BATCH X7645 34006 DK430 32 4098903-099 390H4 093KJS 4390U L490U4 40934 4045903-023 3DGH4 4H3K2S 4690U LE5FU4 S9SE END BATCH O43OI 3490U 4LHJ90 LK I would need the "32" from the "BEGIN" record assigned to a field in the two records betweeen the "BEGIN" and "END" record. -- Tre |
#2
|
|||
|
|||
From the data sample, there doesn't appear to be any similar code that
denotes which BEGIN goes with which END. This could make things rather difficult. Regardless, I would solve using VBA code to locate each BEGIN, and walk through or query the update, until each END -- Steve Clark, Access MVP FMS, Inc. www.fmsinc.com/consulting "TreDogg103" TreDogg103 (at) hotmail (dot) com.(nospam) wrote in message ... I have a table that contains "header and footer" type records... that is... the first record in the table is a record that displays "BEGIN BATCH" and various info about all following records up to the "END BATCH" record. In other words, there are "batches" of records denoted by beginning and ending records at each end of the record range. I need to take the value of a field in the "BEGIN" record and assign that value to all records between the "BEGIN" record and the "END" record. There are multiple "batches" in the table that each need to have this value assigned from their respective "BEGIN" record. I do not control the format of this table as it is created by a third party program. I've tried using DLookUp but it doesn't "loop" like I want it to... it basically shifts all values in that field down one record, rather than assigning to all records in the record range. If anyone can help, I would appreciate it. Here is a basic example of the table: BEGIN BATCH X7645 34006 DK430 32 4098903-099 390H4 093KJS 4390U L490U4 40934 4045903-023 3DGH4 4H3K2S 4690U LE5FU4 S9SE END BATCH O43OI 3490U 4LHJ90 LK I would need the "32" from the "BEGIN" record assigned to a field in the two records betweeen the "BEGIN" and "END" record. -- Tre |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Merging Records from one table to another on different databases | Mike Smith | Running & Setting Up Queries | 3 | November 3rd, 2004 07:02 PM |
count records based on date range | SFatz | Running & Setting Up Queries | 4 | October 8th, 2004 08:24 PM |
Filter Records Code Needed | Dave Elliott | Using Forms | 1 | October 5th, 2004 04:39 AM |
Removing a form and all of the module code for it | Jack Gillis | General Discussion | 4 | July 25th, 2004 07:07 PM |
Hide or show Control Button on Form in Access 97 | Pete Sperling | Using Forms | 8 | July 13th, 2004 04:13 PM |