NULL issue...

tim.breeding

New member
Local time
Today, 14:00
Joined
Sep 15, 2007
Messages
7
OK, I'm having a weird issue with NULL going. I'm exporting some data to a text file. If all of my fields are populated everything works fine, but if one of them is blank(which sometimes it will be) then I get a runtime error '94 Invalid Use of NULL'.

As you can see, I tried to put a selection statement in there to mitigate this, but it's not working. What am I doing wrong here. I'm assuming the error is occurring because I'm trying to subtract 4-NULL.

With rs
Do While Not .EOF
Print #1, ![Contract No] & Space(13 - Len(![Contract No]));

If ![Release No] = Null Then

Print #1, Space(4);

Else

>>This is the problem Line.>>>> Print #1, Space(4 - Len(![Release No])) & ![Release No];

End If

Print #1, !EmpID & Space(10 - Len(!EmpID));
Print #1, Format(!SheetDate, "yyyymmdd");
Print #1, !WorkOrderNumber & Space(20 - Len(!WorkOrderNumber));
Print #1, Trim(!CraftCode) & Space(6 - Len(Trim(!CraftCode)));
Print #1, Trim(!Shift);
Print #1, Space(7 - Len(Format(!StandardTime, "###0.00"))) & Format(!StandardTime, "###0.00");
Print #1, Space(7 - Len(Format(!TimeAndHalf, "###0.00"))) & Format(!TimeAndHalf, "###0.00");
Print #1, Space(7 - Len(Format(!DoubleTime, "###0.00"))) & Format(!DoubleTime, "###0.00");
Print #1, Space(14);
'Print #1, Trim(!Fluor) & Space(6 - Len(Trim(!Fluor)));
Print #1, Trim(![Job Rep]) & Space(8 - Len(Trim(![Job Rep])));
Print #1, Space(5)

.MoveNext
Loop
 
Nothing is *ever* = to Null, including Null.
try:
If IsNull(![Release No]) Then
...rather then:
If ![Release No] = Null Then
 

Users who are viewing this thread

Back
Top Bottom