I am trying to copy a field value to another field in the same record if the Rank = 1
The Table name is : tbl_SSP
Fields: Rank "if rank = 1" then move
Red_Level_Support "This amount" to
Current_Level_of_Funding "this field"
What happen is if I have my cursor on the rank 1, then i is ok, but if my cursor is on some other field, it copies that value. I tried to set the focus and lots of other things, but no luck.
'**************** THE CODE **************
On Error Resume Next
Dim dbsSSP As Database
Dim rst As Recordset
Dim strMessage As String
Set dbsSSP = CurrentDb()
Set rst = dbsSSP.OpenRecordset("tbl_SSP", dbOpenSnapshot)
With rst
.MoveLast
.MoveFirst
' !Rank.SetFocus
Do While Not .EOF
If !Rank = "1" Then
Me.Current_Level_of_Funding = ""
Me.Current_Level_of_Funding = Red_Level_Support
End If
dbsSSP.Close
Exit Do
End If
rst.MoveNext
Loop
End With
The Table name is : tbl_SSP
Fields: Rank "if rank = 1" then move
Red_Level_Support "This amount" to
Current_Level_of_Funding "this field"
What happen is if I have my cursor on the rank 1, then i is ok, but if my cursor is on some other field, it copies that value. I tried to set the focus and lots of other things, but no luck.
'**************** THE CODE **************
On Error Resume Next
Dim dbsSSP As Database
Dim rst As Recordset
Dim strMessage As String
Set dbsSSP = CurrentDb()
Set rst = dbsSSP.OpenRecordset("tbl_SSP", dbOpenSnapshot)
With rst
.MoveLast
.MoveFirst
' !Rank.SetFocus
Do While Not .EOF
If !Rank = "1" Then
Me.Current_Level_of_Funding = ""
Me.Current_Level_of_Funding = Red_Level_Support
End If
dbsSSP.Close
Exit Do
End If
rst.MoveNext
Loop
End With