Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I'm so glad I found this site... Now I can get some sleep, because my problem is solved..."

Geography

Where in the world do Tek-Tips members come from?
sql66666 (Programmer)
12 Apr 12 8:45
I am working in .ADP and converting .mdb modules to .adp;i am facing a problem in making a loop through each record.
I have a table 1 like this:

cellname;neighbor
a          b
a          c
a          d
a          e

i want to put these in another table 2 like this:
cellname;neigh1;neigh2;neigh3;neigh4
a          b      c      d      e
Please guide how to do this in .ADP module.
There are more than one cell name and more than 4 neighbors,This is just for example.Infact neighbors equal64.Also,there is autonumber field in the table.Kindly guide in the form of code.
this is what i used in MS Access.mdb but i need similar thing in .ADP

sample code:
SQL = "SELECT RFPlanNei_OMC2_Modified.SourceLAC_CI, RFPlanNei_OMC2_Modified.DestLAC_CI FROM RFPlanNei_OMC2_Modified ORDER BY RFPlanNei_OMC2_Modified.SourceLAC_CI"
Set sql1 = CurrentDb.OpenRecordset(SQL)

While Not sql1.EOF
source = sql1.Fields.Item(0)

For i = 1 To 36
NC(i) = ""
Next i

a = 1

    While source = sql1.Fields.Item(0) And a < 37
    NC(a) = sql1.Fields.Item(1).value
    a = a + 1
    sql1.MoveNext
    If sql1.EOF = True Then
        sql2 = "Insert Into RFPlanNei_Modified_Final(CELLID, NC1, NC2, NC3, NC4, NC5, NC6, NC7, ) values ( '"
        sql2 = sql2 & source & "','" & NC(1) & "','" & NC(2) & "','" & NC(3) & "','" & NC(4) & "','" & NC(5) & "','" & NC(6) & "','" & NC(7)
    DoCmd.RunSQL sql2
    GoTo BreakLoop
    End If
    Wend
  

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close