J
Joe
I have built the following code in an attempt to find
duplicate entries in a table, ("qry DupTel" is a query
showing the duplicates) I pass two string variables from
the first record (iTel and iAccounts). I then open the
second recordset and attempt to use findfirst to search
for the first record matching the criteria contained in
the variables "iTel and iAccounts". The procedure reports
an error "3251 operation not supported for this object". I
don't think I have got the quotes right within the
criteria! Any help would be appreciated.
Joe
PS. When the record is located I would like to delete the
first entry.
Private Sub Command0_Click()
Dim dbRemTel As DAO.Database
Dim rcdRemTelNum As DAO.Recordset
Set dbRemTel = CurrentDb
Set rcdRemTelNum = dbRemTel.OpenRecordset("qryDupTel")
Dim iTel As String
Dim iCount As Variant
Dim iAccounts As String
rcdRemTelNum.MoveFirst
If Not (rcdRemTelNum.EOF) Then
rcdRemTelNum.MoveFirst
iTel = rcdRemTelNum![phonenum Field]
iAccounts = rcdRemTelNum![code field]
rcdRemTelNum.Close
Dim dbdeleteTel As DAO.Database
Dim rcdDelTel As DAO.Recordset
Set dbdeleteTel = CurrentDb
Set rcdDelTel = dbdeleteTel.OpenRecordset("camphone")
rcdDelTel.FindFirst "[phonenum] = """ & iTel & "
And "
duplicate entries in a table, ("qry DupTel" is a query
showing the duplicates) I pass two string variables from
the first record (iTel and iAccounts). I then open the
second recordset and attempt to use findfirst to search
for the first record matching the criteria contained in
the variables "iTel and iAccounts". The procedure reports
an error "3251 operation not supported for this object". I
don't think I have got the quotes right within the
criteria! Any help would be appreciated.
Joe
PS. When the record is located I would like to delete the
first entry.
Private Sub Command0_Click()
Dim dbRemTel As DAO.Database
Dim rcdRemTelNum As DAO.Recordset
Set dbRemTel = CurrentDb
Set rcdRemTelNum = dbRemTel.OpenRecordset("qryDupTel")
Dim iTel As String
Dim iCount As Variant
Dim iAccounts As String
rcdRemTelNum.MoveFirst
If Not (rcdRemTelNum.EOF) Then
rcdRemTelNum.MoveFirst
iTel = rcdRemTelNum![phonenum Field]
iAccounts = rcdRemTelNum![code field]
rcdRemTelNum.Close
Dim dbdeleteTel As DAO.Database
Dim rcdDelTel As DAO.Recordset
Set dbdeleteTel = CurrentDb
Set rcdDelTel = dbdeleteTel.OpenRecordset("camphone")
rcdDelTel.FindFirst "[phonenum] = """ & iTel & "
And "
Code:
="" & iAccounts"""