Do Until loop possibly?

rsmonkey

Registered User.
Local time
Yesterday, 20:40
Joined
Aug 14, 2006
Messages
298
Afternoon all,

well my problem is I have a list of license's (software) & my bosses have decided that rather than having information saying we have 50 installs & 45 licenses they want licences specifically assigned to people. The assigning is not the problem its the creating this list. Currently my license table consists of:

License_ID
License_Name
No_Purchased
Delta
Installs

however due to licenses now having to be assigned specifically to people i realise that a new table has to be made listing each license indicidually rather than grouping them as i have done above. Im guessing the best way to populate this table is to do a Do Until loop saying insert license name into New_License_Table Until counts = No_Purchased. However i havent find any decent info on the net about these loops so i was hoping some1 could help me tee off this loop so im on the right track unless sum1 has a better idea!

Any help is much appreciated..

Cheers
 
License_ID
License_Name
No_Purchased
Delta
Installs


Im guessing the best way to populate this table is to do a Do Until loop saying insert license name into New_License_Table Until counts = No_Purchased.
However i havent find any decent info on the net about these loops
The best information comes from other people face-to-face, if you ask me! I think you're right on with the loop and the COUNT condition. First thing to do is create a new TableDef and Append the "License" field to it. Then, populate that with the single record data you have from the current "License" table. Make sure you have both recordsets open by way of the Database.Openrecordset method. Once they are open, you can write the loop. Here's what it should look like...

rsOLD = current License table / rsNEW = New TableDef created
Code:
Dim x AS long

rsOLD.MoveFirst

x = rsOLD!nopurchased
    
  Do Until .EOF

        Do Until rsNEW.Recordcount = x

          rsNEW.AddNew
            rsNEW!newfield = rsOLD.licensename
          .Update
        
        Loop

      rsOLD.MoveNext

    x = x + rsOLD!nopurchased

  Loop
That should get you started at least...
 
Last edited:
ahh ajetrumpet that is what im looking for... thankyou I will throw this into the mix and get back to you. Just did a quick count & its gotta create 1.6 million entries.. so when i do get this bad boy right im gonna have to wait all day for it to run ;) its all good though i can just browse the net and tell me boss im working ;)
 

Users who are viewing this thread

Back
Top Bottom