Jass Saini
asked on
How to put zeros as place holders
I have a code that runs and puts the remarks into fields that have a value...I want to run that code and also place a zero for BC1 that does not have a value.
Private Sub Remarks1_AfterUpdate()
Dim rst As DAO.Recordset
Dim strRemarks As String
strRemarks = Me.Remarks1
If strRemarks = "" Then Exit Sub
Set rst = CurrentDb.OpenRecordset("Final_Table")
'strRemarks = Me.Remarks1
Do
rst.Edit
If Nz(rst![BC1Chng1]) <> "" Then
rst![Remarks1] = strRemarks
Else
rst![Remarks1] = Null
End If
rst.Update
rst.MoveNext
Loop Until rst.EOF
End Sub
ASKER
Hello Scott,
Sorry..I need to set BC1 to 0 is there is no value in there..the value can be positive or negative
Sorry..I need to set BC1 to 0 is there is no value in there..the value can be positive or negative
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried this code and BC1Change has a "0" in all the records
Try to upload a sample database demonstrating the issue.
Perhaps:
rst.Edit
If Nz(rst![BC1Chng1]) <> "" Then
rst![Remarks1] = strRemarks
Else
rst![BC1] = "0"
End If
rst.Update
rst.MoveNext
rst.Edit
If Nz(rst![BC1Chng1]) <> "" Then
rst![Remarks1] = strRemarks
Else
rst![BC1] = "0"
End If
rst.Update
rst.MoveNext
rst.Edit
If Nz(rst![BC1Chng1]) <> "" Then
rst![Remarks1] = strRemarks
Else
rst![Remarks1] = "0"
End If
rst.Update
rst.MoveNext