Help with coding

Jass7869

Registered User.
Local time
Today, 11:41
Joined
Aug 12, 2014
Messages
96
Can someone help me understand what this code is doing???

I don't understand the third line and I think that is what is confusing me.

Dim memoContent As String
memoContent = Me.Remarks1
If Nz(Me.BC1Chng1, "") <> 0 Then
Do While Not Me.Recordset.EOF
memoContent = Me.Remarks1
Me.Recordset.MoveNext
Me.Remarks1 = memoContent
Me.Repaint
Loop
Else
MsgBox "Already at last record"
End If
End Sub
 
Code:
 If Nz(Me.BC1Chng1, "") <> 0 Then

The expression checks if the field BC1Chg1 is Null or an empty string. The Nz function and the Boolean test compress two tests (for Null string and string with length = 0) into one.

Best,
Jiri
 
except it should either be

'both text
If Nz(BC1Chng1, "") <> "" Then

OR

'both numeric
If Nz(BC1Chng1, 0) <> 0 Then

so that the nz casts the variable to the type you are testing for
 
What I would like for it to do is to Look at BC1Chng and if there is a number...then do the rest of that stuff. If there is nothing than leave the Remarks1 blank
 
What I would like for it to do is to Look at BC1Chng and if there is a number...then do the rest of that stuff. If there is nothing than leave the Remarks1 blank
And does the code not do that or??
 
Hello JHB,

I used a different code that works. Which is different than the one I posted
 

Users who are viewing this thread

Back
Top Bottom