VB code -- what am I doing wrong?

  • Thread starter Thread starter Stephen Glynn
  • Start date Start date
S

Stephen Glynn

Apologies for what's probably a very basic question, but I know very
little of VB.

I'm trying to adapt some code, to which I which I was kindly directed by
someone on this forum, that appears at

http://www.databasedev.co.uk/duplicates.html

and does exactly what I need to do. I've pasted it into my form's
Before Update event, changed the control names, table names and forth,
and am trying to run it. I'm not getting very far.

The relevant bit is

Dim SID As String
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset

Set rsc = Me.RecordsetClone


I'm using Microsoft Visual Basic 6.3. It stops at 'DAO.Recordset' and
complains 'User defined type not defined'. I've tried changing it to
'Recordset' and re-starting the code, but it then stops at
Set rsc = Me.RecordsetClone and says there's a type mismatch.

What am I doing wrong?

Steve
 
Stephen said:
Apologies for what's probably a very basic question, but I know very
little of VB.

I'm trying to adapt some code, to which I which I was kindly directed
by someone on this forum, that appears at

http://www.databasedev.co.uk/duplicates.html

and does exactly what I need to do. I've pasted it into my form's
Before Update event, changed the control names, table names and forth,
and am trying to run it. I'm not getting very far.

The relevant bit is

Dim SID As String
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset

Set rsc = Me.RecordsetClone


I'm using Microsoft Visual Basic 6.3. It stops at 'DAO.Recordset' and
complains 'User defined type not defined'. I've tried changing it to
'Recordset' and re-starting the code, but it then stops at
Set rsc = Me.RecordsetClone and says there's a type mismatch.

What am I doing wrong?

Steve

That is DAO code. Do you have a reference set in your project to a DAO library?
 
Check that you have Microsoft Data Access Object (DAO) 3.6 Library included
in the References collection of your database.

Use the Menu Tools / References ... in the VBE to check the References ...
 
Back
Top