Problem with recordsets

bri822

Registered User.
Local time
Today, 23:13
Joined
May 23, 2002
Messages
31
OK, I am trying to do something really simply. Open a table called "DropByDay", check to see if there are any records that have the same [PacketDetailID] that is on the form. If any records have the same ID, then delete them. Then Append on a few records with the [PacketDetailID], [Amount], and [date] on a form.

I have been able to append the new records on, the only thing is that I can not seem to get record set to open up right. I had to leave my recordset as a variant type, otherwise it would not open. And as such I can not seem to delete records out of it.

I have been reading about ADO and DAO and it is confusing. I am using 2000, and DAO.Database along with Database are considered user-defined type and are not reconoized and are giving me errors. If anyone can help me, I would greatly appreciate it. Thanks

Brian
 
you wrote
<<
OK, I am trying to do something really simply. Open a table called "DropByDay", check to see if there are any records that have the same [PacketDetailID] that is on the form. If any records have the same ID, then delete them.
>>

Use a delete query with criteria [PacketDetailsID]. Why write code to do this?

RichM
 
You need to add the DAO 3.6 Reference to your project and before any DIM Variables that deal with DAO/ADODB References get in the habit of using DAO/ADODB as a prefix:

Example:

Dim dbDAO as DAO.Database
Dim rstDAO as DAO.Recordset
Dim rstADO as ADODB.Recordset
 

Users who are viewing this thread

Back
Top Bottom