I think there is a problem with datagrid working with Ado connectivity. A lot of forms (please search with key words "DataGrid Ado") remain unanswered.(any way help!)Anybody can throw light on this dark side. Thanks.
For example I have a datagrid connected a table in Access 97 through ADO data control(adodcfeedetail). I have text fields connected to other table through a Ado data control (adofeemaster). Whenever the textfilds change I fetch a different set of records for datagrid. please see my below codes:
Private Sub AdoFeeMaster_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
If AdoFeeMaster.Recordset.EOF Then
AdoFeeMaster.Recordset.MoveLast
End If
If AdoFeeMaster.Recordset.BOF Then
AdoFeeMaster.Recordset.MoveFirst
End If
txtfields(24).Text = AdoFeeMaster.Recordset.Fields!(fee_mstr_recno]
AdodcFEEDETAIL.CommandType = adCmdText
AdodcFEEDETAIL.RecordSource = "select * from fee_detail_trans where [FEE_DETAIL_RECNO]= " & txtfields(24).Text & ""
AdodcFEEDETAIL.Refresh
DataGrid1.Refresh
End Sub
This command fetch and display records whenever txtfields change. But when I add new records at AdoFeemaster and update, it does not have any records in adodcfeedetail so it is not showing any records in datagrid. Fine. But it is not allowing me to add new new rows in datagrid (adding new records in underlying tables) giving error 'current row set not available'.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.