Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2015
    Posts
    17

    Compile error next without for

    Hello everyone I'm working on a form that when the user opens it will display a input box asking how many names you want to add to the list this part works but when I enter the number in the input box I get the compile error next without for and I'm confuse on why this happens can anyone please help me?? I have attach the form. thank you240CCA06.zip

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,945
    Missing the Next line for the second For. Also missing End If for the first If Then and that means the second End If is out of place. Maybe need Exit For in the first For.
    Use indentation in your code and it will be easier to read.
    Code:
    For intI = 0 To UBound(strFirst)
        If strFirst(intI) <> "" Then
            intCount = intCount + 1
            Exit For
        End If
    Next intI
    For intI = 0 To UBound(strLast)
       If strLast(intI) <> "" Then
           intCount = intCount + 1
           Exit For
       End If
    Next
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    Jan 2015
    Posts
    17
    Hi June7
    Thank you for the help I have another question I was hoping you could help me with when I click the add bottom I get Compile error expected array & it's suppouse to check for a value in both text boxes, if either one is missing a message box should let the user know that they need to provide a value for both and this part works, Also if the user tries to add more names then the one's indicated on the input box a message box should let the user know the list is full and if the arrays are not full, then with a If statement within a For … Next loop to find the first element not containing
    data (“”) and assign the names to the respective array elements; and clear the text boxes on the form.
    I'm sure there is a lot of things wrong with this portion of my code, i'm having a hard time with arrays but can't figure out what. Can you please help me?? Thank you240CCA06.zip

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,945
    Cannot download files till Mar 23. If you still need help then, make another post to get my attention.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 7
    Last Post: 07-24-2013, 02:01 PM
  2. Compile Error: Syntax Error in DoCmd.RunSQL Statement
    By Evilferret in forum Programming
    Replies: 1
    Last Post: 08-27-2012, 12:32 PM
  3. Replies: 2
    Last Post: 06-23-2012, 11:59 PM
  4. Replies: 7
    Last Post: 06-08-2012, 09:55 PM
  5. Replies: 6
    Last Post: 09-28-2011, 09:20 PM

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