MS Access (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


accessman -> MS Access (9/16/2005 21:00:44)

Table "na":
id n1 n2
1_ a
2___ b

I want to make one function to fix like this:
id n1 n2
1_ a_ b


Function Edit()
Dim db As Database
Dim rs As Recordset
Dim c As Integer
c = 1

Set db = CurrentDb
Set rs = db.OpenRecordset("na")

Do While c <= 2
rs.Edit
If (IsNull(rs.Fields("n2").Value) And rs.Fields("id") = DMin("id", "na", "[n2]=''")) Then
rs.Fields("n2") = if(rs.Fields("id").Value = 2,rs.fields("n2").Value,Null) // I don't have this idea
End If
rs.Update
rs.delete @id=2
rs.MoveNext

c = c + 1
Loop

Set db = Nothing
Set rs = Nothing
End Function




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.109375