Running Visual Basic code in Access

  • Thread starter Thread starter Roseanne
  • Start date Start date
R

Roseanne

Hi,

I've tried everything and cannot get my vb code to run in Access. For
testing purposes, I am trying to display a simple message in an OnClick
EventProcedure. Any ideas??

Thanks,
Roseanne
 
More info please.....

Can you post an example of the code?

What version of Access?

If A2007, is the source file in a trusted location?

_________

Sean Bailey
 
Thanks for the quick responses.

I am running Access 2007.

I am simply trying to close the form from a command button. I've even tried
displaying a simple message...MsgBox("Test").

The below code is being called from the OnClick event in the button...

Private Sub Test_Click()
On Error GoTo Test_Click_Err

DoCmd.Close , ""


Test_Click_Exit:
Exit Sub

Test_Click_Err:
MsgBox Error$
Resume Test_Click_Exit

End Sub
 
Back
Top