locked
Compile error: Invalid Outsid Procedure

    Question

  • Hi, I'm working with access 2002 and I'm trying to use microsoft visual basic to program a form in access. The aim is to use visual basic to output customer ID as I type in a customer's first and last name. However, when I test the program, I keep getting a message box that states: Compile Error: Invalid Outside Procedure. I'm following a MS Access 2002 book, and I checked every syntax in the code. Every line is typed properly. I"m guessing it has something to do with MVB and not my code. I also get, after I recieve an error message,  a yellow arrow pointing to the very first line on my VB editor (Private Sub LastName_AfterUpdate() ). This line is also highlighted yellow. I'm guessing there must be something wrong with the first line in the VB editor. I was wondering if anyone has seen this type of error message before and If you could give me possible solutions to correct the problem.

     

    Thank You

    Sunday, October 21, 2007 5:58 PM

Answers

  • Samrah,

    I'm not sure I follow your scenario but I believe you are programming with the VB Editor inside an Access Form.  I suggest trying your code in a smaller sample - can you hook up any events in an Access Form with a simple or empty database, ie: Form_Click?

     

    If that doesn't help, you should post your question to the Access or VSTO groups.  Here is the link for the VSTO group:  http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=4&SiteID=1

     

    Help this helps,

    Adam Braden

    Visual Basic Team

    Wednesday, October 24, 2007 12:47 AM