Text Field Problem.....

rburna904

Registered User.
Local time
Today, 09:47
Joined
Jul 10, 2006
Messages
17
Ok I have a form with the following fields:


cboDesc1 = Combo Box (Contains 3 columns to be referenced : 1 Visible and 2 hidden)
txtMemo1 = Text Field
cboDesc2 = Combo Box (Contains 3 columns to be referenced : 1 Visible and 2 hidden)
txtMemo2 = Text Field
cboDesc3 = Combo Box (Contains 3 columns to be referenced : 1 Visible and 2 hidden)
txtMemo3 = Text Field
cboDesc4 = Combo Box (Contains 3 columns to be referenced : 1 Visible and 2 hidden)
txtMemo4 = Text Field

I then have the following code:

Code:
Public Sub SaveLineItems()
Dim iLine AS Integer
Dim iMaxLines AS Integer
iMaxLines = 4
iLine = 1
Do While iLine <= iMaxLines
     MsgBox Me.Controls("cboDesc" & iLine)
     MsgBox Len(Trim(Me.Controls("txtMemo" & iLine)))
iLine = iLine + 1
Loop
End Sub

I get an Invalid Use of Null when there is nothing in the txtMemo field....

What is it I am doing wrong.....

A blank text field should be blank not null....
 
Last edited:
How about replacing :

MsgBox Len(Trim(Me.Controls("txtMemo" & iLine)))

with:

If isnull(Me.Controls("txtMemo" & iLine)) Then
MsgBox "0"
else
MsgBox Len(Trim(Me.Controls("txtMemo" & iLine)))
end if
 
That solved it

That solved that issue....
 

Users who are viewing this thread

Back
Top Bottom