PC Review


Reply
Thread Tools Rate Thread

Creating Records in New Table Using a Loop

 
 
Cathy
Guest
Posts: n/a
 
      25th Jul 2008
I have a table where each record has a quantity. (ie. Item ABC has a qty =
4) I need to create a loop that will create 4 records with each having a qty
of 1 in a new table. How would I go about doing this? (Please make your
responce for a newbie to VBA.)

Thank you!
Cathy
 
Reply With Quote
 
 
 
 
dch3
Guest
Posts: n/a
 
      25th Jul 2008
Can you share the bigger picture? What is the specific need to create a 4
separate records? Do you have a record in one table with related records in
another into which the four will be inserted?

"Cathy" wrote:

> I have a table where each record has a quantity. (ie. Item ABC has a qty =
> 4) I need to create a loop that will create 4 records with each having a qty
> of 1 in a new table. How would I go about doing this? (Please make your
> responce for a newbie to VBA.)
>
> Thank you!
> Cathy

 
Reply With Quote
 
Cathy
Guest
Posts: n/a
 
      25th Jul 2008
At a high level, I need to compare plan data to actual over time and show
early, late, and on-time. My plan records are summarized. My actual records
are individual. I'm having a hard time comparing the following information
without breaking down the plan information.

Plan:
1/1/2008 = 4
1/2/2008 = 1
1/3/2008 = 5

Actual:
1/1/2008 = 1
1/1/2008 = 1
1/1/2008 = 1
1/2/2008 = 1
1/2/2008 = 1
1/3/2008 = 1
1/3/2008 = 1
1/3/2008 = 1
1/3/2008 = 1

How many records were early, late, and on-time? The only way I can think to
do it is break the plan down into individual records and run matching
routines, then compare the results.

If you have a better solution, I would be very interested to hear it!

Thank you,
Cathy

"dch3" wrote:

> Can you share the bigger picture? What is the specific need to create a 4
> separate records? Do you have a record in one table with related records in
> another into which the four will be inserted?
>
> "Cathy" wrote:
>
> > I have a table where each record has a quantity. (ie. Item ABC has a qty =
> > 4) I need to create a loop that will create 4 records with each having a qty
> > of 1 in a new table. How would I go about doing this? (Please make your
> > responce for a newbie to VBA.)
> >
> > Thank you!
> > Cathy

 
Reply With Quote
 
Chris O''''Neill
Guest
Posts: n/a
 
      26th Jul 2008
I'm not a VB/VBA expert so others will have to help you on the technical
side, but in general terms what you're contemplating (processing the "plan"
records in order to compare them with the "actual" recordsl) doesn't sound
like "a good idea" to me. Rather, if anything, you should be processing the
detailed records (summarising them in some way???).

In the "plan" records, what constitutes early, late and on-time? If it's a
planned date and/or time, then you "should" be able to parse through each
"actual" record and compare it to the date/time deadline criteria set out in
the "plan" record . That would tell you whether each "actual" record was
early, late, or on-time. Then, it would just be a matter of totally up the
each category.

Or, maybe I'm not fully understanding what you're trying to do? Perhaps
more info would help? What fields do you have in the "plan" records? What
fields are in the "actual" records? What, specifically, are you trying to
compare?

Sorry I'm not providing answers, but sometimes it's better to focus on
questions rather than answers.

Regards, Chris

"Cathy" wrote:

> At a high level, I need to compare plan data to actual over time and show
> early, late, and on-time. My plan records are summarized. My actual records
> are individual. I'm having a hard time comparing the following information
> without breaking down the plan information.
>
> Plan:
> 1/1/2008 = 4
> 1/2/2008 = 1
> 1/3/2008 = 5
>
> Actual:
> 1/1/2008 = 1
> 1/1/2008 = 1
> 1/1/2008 = 1
> 1/2/2008 = 1
> 1/2/2008 = 1
> 1/3/2008 = 1
> 1/3/2008 = 1
> 1/3/2008 = 1
> 1/3/2008 = 1
>
> How many records were early, late, and on-time? The only way I can think to
> do it is break the plan down into individual records and run matching
> routines, then compare the results.
>
> If you have a better solution, I would be very interested to hear it!
>
> Thank you,
> Cathy
>
> "dch3" wrote:
>
> > Can you share the bigger picture? What is the specific need to create a 4
> > separate records? Do you have a record in one table with related records in
> > another into which the four will be inserted?
> >
> > "Cathy" wrote:
> >
> > > I have a table where each record has a quantity. (ie. Item ABC has a qty =
> > > 4) I need to create a loop that will create 4 records with each having a qty
> > > of 1 in a new table. How would I go about doing this? (Please make your
> > > responce for a newbie to VBA.)
> > >
> > > Thank you!
> > > Cathy

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Lookup Table Using a Do...Until Loop tpolney@tampabay.rr.com Microsoft Access Database Table Design 6 19th Nov 2008 10:56 PM
Loop through Table records dhoover via AccessMonster.com Microsoft Access VBA Modules 7 20th Sep 2007 04:56 PM
Loop thru records in a table =?Utf-8?B?TmlnZWw=?= Microsoft Access VBA Modules 2 12th Sep 2005 06:17 PM
Using Records in a table as Criteria to loop terry Microsoft Access VBA Modules 1 28th Jun 2004 11:24 AM
How to loop through the records of a table using ADO.Net =?iso-8859-1?Q?Jan_Weing=E4rtner?= Microsoft ADO .NET 12 1st Feb 2004 11:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:30 AM.