|
-
May 28th, 2000, 08:23 AM
#1
Thread Starter
New Member
'What is wrong with this code that it picks up 'Name' from record 1 and puts it into every subsequent record 'rather than moving to record 2 and picking up record 2 'Name' and put that in 'LinkID' of record 2 'etc.
Command226 is a button attached to an Access 97 Form
Private Sub
Command226_Click()
' The goal is to go through a record set, taking information from the 'Name' field
' and puting it into another field called LinkID
Dim db As Database
Dim rst As Recordset
Dim mystring As String
Set db = CurrentDb()
Set rst = db.OpenRecordset("NCNames", dbOpenDynaset)
With rst
Do Until .EOF
If [RES_Y_OR_N] = -1 Then
mystring = Left([LAST_NAME], 10) + Left([FirstName], 5)
Else
mystring = Left([BUS_NAME], 15)
End If
.Edit
![LinkID] = mystring
.Update
.MoveNext
Loop
End With
End Sub
[Edited by Alan Thiessen on 05-28-2000 at 07:30 PM]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|