powerbuilderdatawindow

Datawindow Rowscopy Null error


I have 2 windows that has a data window. dw_1 and dw_2 is connected to dw_main. Now, everytime I run the program, pop up message shows

error R0002. Null object reference at line 2

Please help me. What should I do so the data window won't confuse. Note, I am using one data object for the two datawindow.

if dw_1.rowcount( ) <> 0 then 
 dw_1.RowsCopy(1, dw_1.rowcount( ), Primary!,dw_2,  1, Primary!)
end if

Solution

  • Looks like dw_2 is the null object. You should also change your IF statement to " > 0" since a negative return from rowcount is an error condition.