Results 1 to 3 of 3
  1. #1
    accessnewbie is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2009
    Posts
    20

    Out of control loop in autoexec macro

    I have an autoexec macro that I am testing. I wanted it confirm it was looping through the tables in my database by displaying the names of the tables via "msgbox". Something is obviously wrong because I opened the database and a message box pops up with no text in it and an OK button. I can hit the OK button 1 time or 100 times and it won't go away. How do I get back to somewhere I can change the code and fix the loop?



    Sorry for my stupidity.

    accessnewbie

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    may i ask why you are doing this via messagebox? save yourself some time and have it populate a table you can look at.

    As far as the problem goes, I'm going to assume you have the MsgBox inside the loop so its creating a new one for each iteration. Take the MsgBox outside the loop and it'll only go once.

    Better yet, open it up in VBA mode, create a variable that will hold the text of the tables, then just debug.print it. itll show them all in the immediate window.

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    AND...opening the db while holding down a <SHIFT> key will bypass the AutoExec macro, in case you did not know that.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Do While loop
    By jgelpi16 in forum Programming
    Replies: 7
    Last Post: 07-23-2010, 08:21 AM
  2. VBA Loop
    By DreamOn in forum Programming
    Replies: 4
    Last Post: 06-25-2010, 03:35 AM
  3. For Each LOOP statement
    By zambam737 in forum Programming
    Replies: 3
    Last Post: 10-26-2009, 09:59 PM
  4. Using parameter in autoexec macro
    By lchurch in forum Queries
    Replies: 0
    Last Post: 03-04-2009, 06:22 PM
  5. Sending control to specific control
    By wasim_sono in forum Programming
    Replies: 2
    Last Post: 04-19-2007, 08:19 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums