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

Open in new window

Jass SainiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
This should work:

  rst.Edit
        If Nz(rst![BC1Chng1]) <> "" Then
         rst![Remarks1] = strRemarks
      Else
         rst![Remarks1] = "0"
      End If
      rst.Update
      rst.MoveNext
Jass SainiAuthor Commented:
Hello Scott,

Sorry..I need to set BC1 to 0 is there is no value in there..the value can be positive or negative
Hamed NasrRetired IT ProfessionalCommented:
rst![BC1] = Nz(rst![BC1], 0)
rst.Update

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Jass SainiAuthor Commented:
I tried this code and BC1Change has a "0" in all the records
Hamed NasrRetired IT ProfessionalCommented:
Try to upload a sample database demonstrating the issue.
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Perhaps:

rst.Edit
        If Nz(rst![BC1Chng1]) <> "" Then
         rst![Remarks1] = strRemarks
      Else
        rst![BC1] = "0"
      End If
      rst.Update
      rst.MoveNext
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.