Hi All,

Anyone know why is is failing with the error "Object reference not set to an instance of an object"?

I know it's failing at the line indicated...

VB Code:
  1. sSql = "Select CUSTOMERCODE, CUSTOMERNAME, CUSTOMERADD1, CUSTOMERADD2, CUSTOMERADD3, CUSTOMERADD4, CUSTOMERPOSTCODE, CUSTOMERPRICECODE from PU_CUSTOMERDETAILS"
  2.  
  3. rsCustomerData.Open(sSql, m_dbconn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, -1)
  4.  
  5. 'Loop through all customer records
  6. If rsCustomerData.EOF = False Then
  7.     rsCustomerData.MoveFirst()
  8.  
  9.     'Set up the progressbar...
  10.     lProgressBarCount = 0
  11.     MainForm.ProgressBar1.Minimum = 1
  12.    
  13.     'Error on this line (with the rsCustomerData.RecordCount bit)
  14.     MainForm.ProgressBar1.Maximum = rsCustomerData.RecordCount
  15.  
  16.  
  17.     '...blah blah blah

By the way, this code runs fine in the Dev environment but not when compiled and installed on the client machine.