Unanswered: DAO & ADO Ref problem-FED UP-Help please
I have used DAO in my code as follows:
Dim db As DAO.Database
Dim rst1 As DAO.Recordset
Dim fld As DAO.Field
'Further code lines here..
Which works fine.
I then used ADO in VBA in same db as follows:
Private Sub P_UpDate(ByVal Tnm As String, _
ByVal TotRct As Long, ByVal Cdn As String) Dim rst As ADODB.Recordset, Cnt As Long, Rct As Long
Set rst = New ADODB.Recordset
Set rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenKeyset
rst.CursorLocation = adUseClient
'Some more code lines here.
When compiles, it produces error as follows:
User-defined type not defined
To come over this I set the library file from Reference in VBA (Pic attached for ready reference). Also I moved refences ups and downs to change the order to avoid the error. But error still persist.
I am fed up of this error. Can somebody of you help me to solve this issue ?
ADO was working since long but latestly I used DAO also for a specific task and since then it started to produce error.
One more thing. The Private sub of ADO is for a particular Form which is not presently I kept in the db. DO YOU THINK THAT BECAUSE FORM IS NOT INCLUDED IN THE DB AND ITS CODE IS STILL REMAIN IN VBA HENCE IT PRODUCES ERROR ? Or what exactly I should take action to avoid this error ?