Help with coding (1 Viewer)

Jass7869

Registered User.
Local time
Today, 11:08
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
 

Solo712

Registered User.
Local time
Today, 14:08
Joined
Oct 19, 2012
Messages
828
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
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 19:08
Joined
Sep 12, 2006
Messages
15,660
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
 

Jass7869

Registered User.
Local time
Today, 11:08
Joined
Aug 12, 2014
Messages
96
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
 

JHB

Have been here a while
Local time
Today, 20:08
Joined
Jun 17, 2012
Messages
7,732
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??
 

Jass7869

Registered User.
Local time
Today, 11:08
Joined
Aug 12, 2014
Messages
96
Hello JHB,

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

Users who are viewing this thread

Top Bottom