Hi dorji,
I'm afraid that you are wrong. In adp projects the access object form
recordset is ADO recordset (see the form recordset property in help).
Also, recordsetclone is neither DAO nor ADO recordset property, but a
property of a form object, as you can see in the code that you posted in
your first question:
' here frm is a variable that represents a form
Public Sub EnableButtons(frm As Form, DelBtn As Boolean)
' here 'rst' is a variable recordset
Dim rst As DAO.Recordset
' we assign the form's recordset represented in 'frm' variable
' to 'rst' variable through the RecordsetClone property
Set rst = frm.RecordsetClone
...
so, that code works if you are in an mdb file. If you want that code to work
in an adp project, the only thing you have to change is the 'rst' type of
variable from DAO.Recordset to ADODB.Recordset, as I told you in my previous
answer (before posting my answer I tried that in an adp project and it
worked as expected).
--
Saludos desde Barcelona
Juan M. Afan de Ribera
<MVP Ms Access>
http://www.juanmafan.tk
http://www.clikear.com/webs4/juanmafan
"dorji dukpa" <(E-Mail Removed)> escribió en el mensaje
news:042b01c3a699$4da87a80$(E-Mail Removed)...
Even in adp projects the forms still have DAO recordset.
Moreover the ADODB recordset does not support
RECORDSETCLONE method.
Dorji
>-----Original Message-----
>The only thing you have to change is the line
>
> Dim rst As DAO.Recordset
>
>with
>
> Dim rst As ADODB.Recordset
>
>because in adp projects a form recordset is ADO type
instead of DAO type.
>
>HTH
>
>--
>Saludos desde Barcelona
>Juan M. Afan de Ribera
><MVP Ms Access>
>http://www.juanmafan.tk
>http://www.clikear.com/webs4/juanmafan
>
>
>"dorji dukpa" <(E-Mail Removed)>
escribió en el mensaje
>news:090001c3a5e6$6bb15230$(E-Mail Removed)...
>> I've a function to Enable/Disable buttons. It works very
>> well in Access 97/mdb 2000.
>> <<The Function>
>> Public Sub EnableButtons(frm As Form, DelBtn As Boolean)
>> Dim rst As DAO.Recordset
>> Set rst = frm.RecordsetClone
>> If frm.NewRecord Then
>> frm!cmdPrevious.Enabled = True And
rst.RecordCount
>> > 0)
>> frm!CmdNext.Enabled = False
>> Else
>> rst.Bookmark = frm.Bookmark
>> rst.MovePrevious
>> frm!cmdPrevious.Enabled = Not rst.BOF
>> rst.Bookmark = frm.Bookmark
>> rst.MoveNext
>> frm!CmdNext.Enabled = Not (rst.EOF Or
>> frm.NewRecord)
>> End If
>> End Sub
>>
>> Can anyone suggest as to how make this function work in
>> Access 2000 Project (.adp) database.?
>>
>> Thanks in advance
>
>
>.
>