get rid of invalid null statements

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report that will generate barcodes for each of 2 fields. If either,
or both, fields are blank I get an "invalid null" message when running the
report. How can I eliminate these invalid null messages when running the
report? The two fields are NonStockBarcode, and StockBarcode.
The report to generate the barcodes is as follows:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Result = SetBarData(NonStockBarcode, Me)
Result = SetBarData(StockBarcode, Me)
End Sub

Thanks
Patrick
 
Ãou havent posted the function, so I don't know what you are trying to do
with the two parameter that you are passing.
If you don't want to run the function if its null then use that
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If not isnull(NonStockBarcode) then
Result = SetBarData(NonStockBarcode, Me)
End if
If Not isNull(StockBarcode) then
Result = SetBarData(StockBarcode, Me)
End If
End Sub
==========================
Or, the other option is, to pass a different parameter instead of null, like
0 in this example
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Result = SetBarData(NZ(NonStockBarcode,0), Me)
Result = SetBarData(NZ(StockBarcode,0), Me)
End Sub
 
Back
Top