Compile Error - On Form Current - After splitting database

steve21nj

Registered User.
Local time
Today, 12:16
Joined
Sep 11, 2012
Messages
260
Good afternoon,

I was wondering if anyone experienced a similar problem after splitting a database. Prior to creating a front and back end, my code worked perfectly. After splitting, I am generating a compile error, highlighting the line Dim dbs As Database.

The code basically deletes the data in a holding table. Nothing fancy. Just not sure why it stopped working after splitting.

Any suggestions?

Code:
Private Sub Form_Current()
  Dim dbs As Database
 
  Set dbs = CurrentDb
 
  dbs.Execute ("DELETE * FROM tblPropertyDetailsDummy")
  Me!From.SetFocus
End Sub
 

Attachments

  • Capture.PNG
    Capture.PNG
    19.7 KB · Views: 102
Access might just be mixing up DAO and ADODB for your database type.

Check your references to see if you have both types - and perhaps be more specific ie DAO.Database
 
Thank you for the reply. After an hour, I saw that my DAO 3.6 Reference was not active.
 

Users who are viewing this thread

Back
Top Bottom