B
BeccySmith
I have got the following code in a database someone else
designed. I'm not sure what all the function actually
do. Can anyone help? I am having problems around the
Index statement and the EOF statement in particular.
Function wl_update_nonres2()
Dim wait As Database, wl As Recordset, prov As Recordset
Set wait = DBEngine.Workspaces(0).Databases(0)
Set wl = wait.OpenRecordset("WL NonRes Test")
Set prov = wait.OpenRecordset("Provider Codes")
wl.Index = "Provider"
wl.MoveFirst
Do Until wl.NoMatch
wl.Seek "=", Null
If Not wl.NoMatch Then
site = wl![prov_code]
prov.MoveFirst
While Not prov.EOF
If site = prov![site_code] Then
PRV = prov![prov_code]
End If
prov.MoveNext
Wend
wl.Edit
wl![provider] = PRV
wl.Update
End If
wl.MoveNext
Loop
End Function
designed. I'm not sure what all the function actually
do. Can anyone help? I am having problems around the
Index statement and the EOF statement in particular.
Function wl_update_nonres2()
Dim wait As Database, wl As Recordset, prov As Recordset
Set wait = DBEngine.Workspaces(0).Databases(0)
Set wl = wait.OpenRecordset("WL NonRes Test")
Set prov = wait.OpenRecordset("Provider Codes")
wl.Index = "Provider"
wl.MoveFirst
Do Until wl.NoMatch
wl.Seek "=", Null
If Not wl.NoMatch Then
site = wl![prov_code]
prov.MoveFirst
While Not prov.EOF
If site = prov![site_code] Then
PRV = prov![prov_code]
End If
prov.MoveNext
Wend
wl.Edit
wl![provider] = PRV
wl.Update
End If
wl.MoveNext
Loop
End Function