After Importing to blank DB (Error)

B

Bob V

After Importing my files to a Blank DB, I am getting this compile error:
I have a 2 buttons that select and de select all items in my Continuous
Forms, but when I select them I get this error...Thanks Bob
Sub SelAllNone(Optional SelectAll As Boolean = True)
On Error GoTo stoprun

Dim sqlStr As String
Dim *****wrk As Workspace****ERROR*************************************
Dim db As Database

Set wrk = DBEngine.Workspaces(0)
Set db = CurrentDb


sqlStr = "UPDATE [tblHorseInfo] SET [Worksheet] = " & SelectAll & ";"
wrk.BeginTrans
db.Execute sqlStr, dbFailOnError
wrk.CommitTrans

Exit_Here:
Set wrk = Nothing
Set db = Nothing
Exit Sub

stoprun:
MsgBox Err.Number & " - " & Err.Description
wrk.Rollback
Resume Exit_Here
End Sub
 
J

John W. Vinson

After Importing my files to a Blank DB, I am getting this compile error:
I have a 2 buttons that select and de select all items in my Continuous
Forms, but when I select them I get this error...Thanks Bob
Sub SelAllNone(Optional SelectAll As Boolean = True)
On Error GoTo stoprun

Dim sqlStr As String
Dim *****wrk As Workspace****ERROR*************************************
Dim db As Database

Be sure that you have Microsoft DAO x.xx selected in Tools... References.

John W. Vinson [MVP]
 
B

Bob V

Thanks John, that did the trick....Bob :)

John W. Vinson said:
Be sure that you have Microsoft DAO x.xx selected in Tools... References.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top