full error msg:
Item cannot be found in the collection corresponding to the requested name or ordinal
Here is the code I have. I am using VBa as front end, with an Oracle db. I am using ADO and OLEDB:
Dim sFaults As String
On Error GoTo selectERR
sFaults = "SELECT Visit_ID, LoggerNo, MPRN, FaultDetails, AF_Meter_Reading, "
sFaults = sFaults & "AF_Logger_Reading, AL_Meter_Reading, AL_Logger_Reading, "
sFaults = sFaults & "fault_Maint, Maint_Date, Done_By FROM meterFAULTS where "
sFaults = sFaults & " MPRN = " & MPRN & " ORDER BY "
sFaults = sFaults & "Maint_Date DESC"
rstFaults.Open sFaults, conn, adOpenKeyset
Set Forms!frmLoggerMaint!frmLogMaintSUBF.Form.Recordset = rstFaults
I have subsituted the recordset for a DAO recset, using a local table and it worked fine. I also have an identical piece of code in another form, which works fine.
Anyone got any suggestions??? Why douesn't it like this ADO recordset??
Cheers! Nick (Everton Rool OK!)
Item cannot be found in the collection corresponding to the requested name or ordinal
Here is the code I have. I am using VBa as front end, with an Oracle db. I am using ADO and OLEDB:
Dim sFaults As String
On Error GoTo selectERR
sFaults = "SELECT Visit_ID, LoggerNo, MPRN, FaultDetails, AF_Meter_Reading, "
sFaults = sFaults & "AF_Logger_Reading, AL_Meter_Reading, AL_Logger_Reading, "
sFaults = sFaults & "fault_Maint, Maint_Date, Done_By FROM meterFAULTS where "
sFaults = sFaults & " MPRN = " & MPRN & " ORDER BY "
sFaults = sFaults & "Maint_Date DESC"
rstFaults.Open sFaults, conn, adOpenKeyset
Set Forms!frmLoggerMaint!frmLogMaintSUBF.Form.Recordset = rstFaults
I have subsituted the recordset for a DAO recset, using a local table and it worked fine. I also have an identical piece of code in another form, which works fine.
Anyone got any suggestions??? Why douesn't it like this ADO recordset??
Cheers! Nick (Everton Rool OK!)