AshikHusein
Registered User.
- Local time
- Today, 12:39
- Joined
- Feb 7, 2003
- Messages
- 147
Could anyone tell me waht is wrong with this code? It is not going through the IF statement even when the IF conditions are met.
For a brief explanation, the procedure is invoked when a button on a form "Comman26" is clicked.
After the button is clicked, the record set is opened and updated. "Debit Balance Cleared" and "Completed" are Yes/No fields.
The problem is that even if one of them has been check marked (on the form before the button is clicked) it does not go through the IF statement. Part of the code with the problem has been presented below.
Private Sub Command26_Click()
Dim db As Database
Dim rec As DAO.Recordset
Dim Count, counter1 As Integer
Dim TheUser As String
Application.SetOption "Default Record Locking", 2
On Error GoTo Error_Routine1
TheUser = fOSUserName
Set rec = Me.RecordsetClone
rec.Bookmark = Me.Bookmark
If (rec("Completed") = True) Or (rec("Debit Balance Cleared") = True) Then
MsgBox ("Yes")
rec.Edit
rec("UserCompleted") = TheUser
rec("UserCompleted_Date") = Now()
rec("UserCompleted_Count") = 1
rec("UserPending_Count") = 0
rec.Update
End If
Have bropken my head on this one but still cannot figure it out. Would appreciate help
For a brief explanation, the procedure is invoked when a button on a form "Comman26" is clicked.
After the button is clicked, the record set is opened and updated. "Debit Balance Cleared" and "Completed" are Yes/No fields.
The problem is that even if one of them has been check marked (on the form before the button is clicked) it does not go through the IF statement. Part of the code with the problem has been presented below.
Private Sub Command26_Click()
Dim db As Database
Dim rec As DAO.Recordset
Dim Count, counter1 As Integer
Dim TheUser As String
Application.SetOption "Default Record Locking", 2
On Error GoTo Error_Routine1
TheUser = fOSUserName
Set rec = Me.RecordsetClone
rec.Bookmark = Me.Bookmark
If (rec("Completed") = True) Or (rec("Debit Balance Cleared") = True) Then
MsgBox ("Yes")
rec.Edit
rec("UserCompleted") = TheUser
rec("UserCompleted_Date") = Now()
rec("UserCompleted_Count") = 1
rec("UserPending_Count") = 0
rec.Update
End If
Have bropken my head on this one but still cannot figure it out. Would appreciate help