Code does not work

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I converted all my macros to code and I also tried some test code (basic
docmd open) open form stuff. None of my code seems to work. Macros are the
only thing that works and not the code. I have office 2007 and Vista. Do I
need to install the jet db or? what is going on?
 
Converting the code is not enough. It doesn't have any idea where to put the
code. You will have to go to each place in your app where you run a macro
and replace the execution of the macro with the executioin of the code
converted from that macro.
 
I dont understand what you mean? It now shows an event procedure where the
macro use to be in my properties. Such as On Click on my button. The code it
converted to looks fine so why does it not work? Are you saying I must do
something further? Please explain.

Thank you
 
Here is a basic open form code based off a button from my main form. It is on
the on_click event...

'------------------------------------------------------------
' Ctl_Exit_AMTS_Click
'
'------------------------------------------------------------
Private Sub Ctl_Exit_AMTS_Click()
On Error GoTo Ctl_Exit_AMTS_Click_Err

DoCmd.Quit acPrompt


Ctl_Exit_AMTS_Click_Exit:
Exit Sub

Ctl_Exit_AMTS_Click_Err:
MsgBox Error$
Resume Ctl_Exit_AMTS_Click_Exit

End Sub
 
I forgot to mention that I just went back and checked my other database and
none of my code works. Only macros. Hope this helps in drilling down my
issue. Thanks so mcuh for your help!
 
I just read somewhere today that VBA support is turned off, by default, in
Access 2007. I think you'll have to turn it back on, but I have no idea where
you'll find it. Try Help.
 
I am sure this may be the problem as none of my code works. Does anyone out
there know how to turn on the VBA support?
 
You know, I suggested this to you days ago!

You need to add the path where your database is stored to the Trusted
Locations. You do this through the Office Button | Access Options | Trust
Center | Trusted Locations.
 
Back
Top