VB Code Issue

  • Thread starter Suzanne Lejeune
  • Start date
S

Suzanne Lejeune

I have this code that I have been using for several projects and for some
reason, this time around it won't work. Can someone take a look at it and
see why it doesn't work?

Private Function HandleButtonClick(intBtn As Integer)
' This function is called when a button is clicked.
' intBtn indicates which button was clicked.

' Constants for the commands that can be executed.
Const conCmdGotoSwitchboard = 1
Const conCmdOpenFormAdd = 2
Const conCmdOpenFormBrowse = 3
Const conCmdOpenReport = 4
Const conCmdCustomizeSwitchboard = 5
Const conCmdExitApplication = 6
Const conCmdRunMacro = 7
Const conCmdRunCode = 8

' An error that is special cased.
Const conErrDoCmdCancelled = 2501

Dim dbs As DAO.Database
Dim rst As DAO.Recordset


On Error GoTo HandleButtonClick_Err

No matter what I change, I end up in the HandleButtonClick_err and it
displays the error message.

Thanks!
 
V

Van T. Dinh

Since you didn't post the error message or the line of code that gives the
error, I can only guess: If you use A2K or later, make sure the DAO Library
is included in the References of your database.
 

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