The information in this article applies to:
SUMMARYThis article lists error codes, messages, and explanations for errors that can occur at run time along with some errors that can occur at compile time or bind time. Each error message appears as a heading in this article. MORE INFORMATION1 NEXT without FORThis error is not trappable because it cannot occur at run time. Each NEXT statement must have a matching FOR statement as in this example:
POSSIBLE SOLUTION:Match up all FOR...NEXT pairs in each control structure, inserting additional FOR or NEXT items as required. 2 Syntax Error
3 RETURN without GOSUBThe program executed a RETURN statement without executing GOSUB.POSSIBLE SOLUTIONS:
4 Out of DATAA READ statement has been executed, but no DATA statements with unread data remain in the program.POSSIBLE SOLUTIONS:
5 Illegal Function CallYou are attempting to give an improper or out-of-range argument to a Basic statement. Examples of such errors are:
6 Overflow
7 Out of MemoryMore memory was required for an operation than was currently available.POSSIBLE SOLUTIONS:
If you are using Visual Basic and expanded memory, ensure that expanded memory is available:
8 Label Not DefinedA line label is referenced (in a GOTO statement, for example), but does not occur in the program. This error is not trappable because it cannot occur at run time.POSSIBLE SOLUTIONS:
9 Subscript Out of RangeAn array element was referenced with a subscript that is outside the dimensions of the array, or an element of an undimensioned dynamic array has been accessed. You may also get this error if the following is true:
10 Duplicate Definition
11 Division by ZeroThis error is caused by dividing by zero in an expression.POSSIBLE SOLUTIONS:
12 Illegal in Direct ModeThe highlighted statement is valid only in a program, not in the Immediate window. This error is not trappable because it cannot occur at run-time. As a rule, the following statements and metacommands cannot be used in the Immediate window:
13 Type Mismatch
14 Out of String SpaceThere are too many string variables for the amount of memory available. Strings compete with other types of program data for memory.POSSIBLE SOLUTIONS:
16 String formula too complexEither a string formula is too long, or an INPUT statement requests more than 15 string variables.POSSIBLE SOLUTION: Break the formula or INPUT statement into smaller parts. 18 FUNCTION not definedThis error is not trappable because it cannot occur at run-time. You must define a function before using it.POSSIBLE SOLUTIONS:
19 No RESUMEThe end of the program was encountered while the program was executing an error-handling routine.POSSIBLE SOLUTION: Add a RESUME statement in the error-handler routine. 20 RESUME without errorA RESUME statement was executed, but there is no active error handler.POSSIBLE SOLUTION: Isolate the error handler from linear execution of the program with END or EXIT SUB statements. 24 Device timeoutThe program did not receive information from an I/O device within a predetermined amount of time.25 Device faultA device has returned a hardware error indicating that you either tried to print a file when the printer is not attached to the parallel port LPT1, or you transmitted data to a communications file and the signals being tested with the OPEN COM statement were not found in the specified period of time.16 FOR without NEXTThis error is not trappable because it cannot occur at run-time. Each FOR statement must have a matching NEXT statement. For example:
17 Out of paperThe printer is out of paper.POSSIBLE SOLUTION: Fill the printer with paper and verify that the printer cable is securely connected to both printer and computer, the printer power is on, and the online indicator light is lit. 19 WHILE without WENDThis error is not trappable because it cannot occur at run-time. Each WHILE statement must have a matching WEND statement. For example:
Verify that other control structures within the WHILE...WEND structure are
correctly matched. For example, an IF without a matching ENDIF inside the
WHILE...WEND structure generates this error.
The DO...LOOP statement provides a more powerful and flexible loop control structure than WHILE...WEND. 10 WEND without WHILEThis error is not trappable because it cannot occur at run-time. Each WEND statement must have a matching WHILE statement. For example:
Verify that other control structures within the WHILE...WEND structure are
correctly matched. For example, an IF without a matching ENDIF inside the
WHILE...WEND structure generates this error.
The DO...LOOP statement provides a more powerful and flexible loop control structure than WHILE...WEND. 13 Duplicate labelTwo program lines were assigned the same number or label. Each line number or label in a module must be unique. This error is not trappable because it cannot occur at run-time.POSSIBLE SOLUTIONS:
15 Subprogram not definedThis error is not trappable because it cannot occur at run-time. It can be caused by any of these conditions:
17 Argument-count mismatchAn incorrect number of arguments was used in a SUB or FUNCTION procedure call. This error is not trappable because it cannot occur at run-time.POSSIBLE SOLUTIONS:
18 Array not definedThis error is not trappable because it cannot occur at run-time. It occurs when your program tries to use an array that is not defined, or when you have an undeclared function that appears to be an array. For example:
POSSIBLE SOLUTION:
Ensure the array is defined by a DIM or REDIM statement, and verify that
all functions have been declared by the DECLARE statement.
10 Variable requiredAt compile time, Visual Basic encountered an INPUT, LET, READ, or SHARED statement without a variable argument. Or at run time, a GET or PUT statement did not specify a variable when an operation was performed on a file opened in binary mode.10 FIELD overflowA FIELD statement attempted to allocate more bytes than were specified for the record length of a random file.11 Internal errorAn internal malfunction occurred in Visual Basic for MS-DOS. Report the conditions under which the message appeared to Microsoft Product Support.12 Bad file name or number
13 File not foundWhen running a program, a FILES, KILL, NAME, OPEN, PRINT, or RUN statement refers to a file that does not exist. When starting Visual Basic or when opening a file in Visual Basic, you may have a PWB .MAK file with the same base file name as your source file.POSSIBLE SOLUTIONS:
54 Bad file mode
15 File already open
56 FIELD statement activeA GET or PUT statement specified a record variable on a file for which FIELD statements have already been executed. GET or PUT with a record-variable argument can be used only on files where no FIELD statements have been executed.57 Device I/O errorAn input or output error occurred while your program was using a device such as the printer or a disk drive.58 File already existsThe file name specified in a NAME statement is identical to a file name already in use on the disk.POSSIBLE SOLUTIONS:
19 Bad record lengthA GET or PUT statement was executed that specified a record variable whose length did not match the record length specified in the corresponding OPEN statement.11 Disk fullEither there isn't enough room on the disk to complete a PRINT #, WRITE #, or CLOSE operation, or there isn't enough room for Visual Basic to write out an object or executable file.12 Input past end of fileAn INPUT # statement read from a null (empty) file or from a file in which all data has already been read.POSSIBLE SOLUTION: Use the EOF function to detect the end of file. 63 Bad record numberThe record number in a PUT or GET statement was less than or equal to zero.POSSIBLE SOLUTION: Use the LOC function to detect the current position within an open file. 64 Bad file nameEither a file name does not follow the appropriate naming convention for BLOAD, BSAVE, KILL, or OPEN (for example, the file name has too many characters), or you are trying to load an invalid project file (Visual Basic for Windows, NMAKE/PWB) into Visual Basic for MS-DOS.67 Too many filesAt compile time, this error occurs when include files are nested more than five levels deep. At run time, the following can cause this error:
POSSIBLE SOLUTIONS:
68 Device unavailableYou tried to open a file that is not online or does not exist.POSSIBLE SOLUTIONS:
69 Communication-buffer overflowDuring remote communications, the receive buffer overflowed. The size of the receive buffer is set by the /C command-line option or the RB option in the OPEN COM statement.POSSIBLE SOLUTION: Check the buffer frequently by using the LOC function, and empty the buffer frequently by using the INPUT$ function. 70 Permission deniedYou tried to write to a write-protected disk, to access a locked file, or to use UNLOCK on a file that was not locked.POSSIBLE SOLUTIONS:
71 Disk not readyThere is no disk is in the disk drive, or the disk-drive door is open.POSSIBLE SOLUTION: Insert a disk in the disk drive, and make sure the disk-drive door is closed. 72 Disk-media errorDisk-drive hardware has detected a physical flaw on the disk.POSSIBLE SOLUTION: Use a different disk. 73 Feature unavailableThe following can cause this error:
74 Rename across disksYou attempted to rename a file with a new drive designation, which you cannot do in Visual Basic.POSSIBLE SOLUTION: Rename the file on the current disk. Then copy it to the new drive location. 75 Path/File access errorEither during an OPEN, MKDIR, CHDIR, or RMDIR operation, the operating system was unable to make a correct connection between the path and file name, or you tried to save a file that replaces an existing read-only file. If a project (.MAK) file is read-only, the entire program cannot be saved.POSSIBLE SOLUTIONS:
76 Path not foundDuring an OPEN, MKDIR, CHDIR, or RMDIR operation, the operating system was unable to find the path specified.POSSIBLE SOLUTION: Verify the path specified exists. For example, a path specified in the Options.Path dialog may not be valid. If you are creating the path, make sure you don't reference the path until after it is created. 80 Feature removedYou removed this feature by linking with a stub file.POSSIBLE SOLUTION: Relink your program without a stub file. 81 Invalid nameThe rules of naming an ISAM object (such as a table, column, or index) are different from the rules for naming a Visual Basic object (such as a variable or procedure). For example, ISAM names:
Verify that your ISAM object adheres to the ISAM naming conventions defined above and change the reference as required. 82 Table not foundA DELETEINDEX statement references a table that does not exist.POSSIBLE SOLUTIONS:
13 Index not foundThere is no index with the specified name for the ISAM table referenced by a file number argument in a DELETEINDEX or SETINDEX statement.POSSIBLE SOLUTIONS:
84 Invalid columnWhen opening a file for ISAM and specifying a data type, you referenced an element name that is not a column name. Or when creating an ISAM index, you named a column that does not exist or that has a data type that cannot be indexed (an array or user-defined type).POSSIBLE SOLUTION: Verify that all element names referenced when opening the ISAM file are valid column names, and when creating an ISAM index, verify that columns exist and are not arrays or user-defined types. 85 No current recordThere was no current record to delete, retrieve, or update when an ISAM DELETE, RETRIEVE or UPDATE statement was executed. Or an ISAM MOVENEXT or MOVEPREVIOUS statement was executed on a file that does not have a next or previous record.86 Duplicate value for unique indexEither a unique index is current for an ISAM table, and the user attempted to enter a value that is already in the column, or a CREATEINDEX statement was executed with a nonzero unique argument value, and the existing columns already contain values that are not unique.POSSIBLE SOLUTIONS:
87 Invalid operation on NULL indexYou cannot perform an ISAM MOVELAST or SEEK operation on a NULL index.POSSIBLE SOLUTIONS:
88 Database needs repairAn OPEN FOR ISAM statement attempted to open a file that needs repair.POSSIBLE SOLUTION: Use the ISAMREPR.EXE utility to recover (restore physical integrity to) the database. 89 Insufficient ISAM buffersThere are not enough buffers to handle ISAM file processing.POSSIBLE SOLUTION: When you invoke BC.EXE or VBDOS.EXE, use the /Ib command-line option to increase the number of ISAM buffers. 260 No timer available
POSSIBLE SOLUTION: Remove some of the timer controls on the active form. 271 Invalid screen modeYou tried to unload or show forms in an invalid screen mode. For example:
POSSIBLE SOLUTION:Use the SCREEN statement to set the screen mode to 0 before forms are displayed. In some cases, you will also need to use the WIDTH statement to reset the screen width to 80 columns. For example:
272 Invalid when forms are showingYou tried to use a function or statement that is not available when forms are showing.POSSIBLE SOLUTIONS:
340 Control array element does not existYou used an index value that does not correspond to an existing element in the specified control array.POSSIBLE SOLUTION: Adjust the value or load a control into the array with an index equal to the value specified. 341 Invalid object array indexYou used a negative index value or one that falls outside the valid range. The index for an object array element cannot be less than 0 or greater than 32,767.POSSIBLE SOLUTION: Change the array index to a value within the valid range. 342 Not enough room to allocate control arrayThere isn't enough memory to create all the elements of a control array. Each form is limited to 64K for controls and data.POSSIBLE SOLUTIONS:
343 Object not an arrayA control that is not part of any array was referenced as if it had an index. For example:
Reference an object as an array element only if it is defined as part of a
control array.
POSSIBLE SOLUTIONS:
344 Must specify index for object arrayThe referenced control is part of a control array. Use this syntax instead:
ctlname is the name of the control and index is the value of the control's
Index property. If you created the control at design time, find the index
of the control by selecting it and viewing its Index property.
POSSIBLE SOLUTION: Include the control array index in the object reference. 345 Reached limit: cannot create any more controls for this formNo more than 255 menu items or controls are allowed on each form.POSSIBLE SOLUTION: Redesign your application so that a second form holds some of the controls. 360 Object already loadedYou tried to load a control array element that is already been loaded.POSSIBLE SOLUTIONS:
361 Can't load or unload this objectEither you tried to load or unload one of the special objects SCREEN, PRINTER, or CLIPBOARD, or you tried to load or unload a control that is not an element of an existing control array.POSSIBLE SOLUTION: Compare the LOAD or UNLOAD statement syntax you are using with the Help syntax and reconcile any differences. 362 Can't unload controls created at design timeOnly control array elements loaded at run time can be unloaded. If a control is created at design time, it cannot later be unloaded, even if it is part of a control array.POSSIBLE SOLUTION: Hide the control by setting the Visible property to False (0). 364 Object was unloadedYou tried to unload an object that has already been unloaded. For example, you may have unloaded a form from its own Form_Load event procedure while an implicit load occurred. For example:
POSSIBLE SOLUTIONS:
365 Unable to unload within this contextIn the following situations, you are not allowed to unload a form or a control on a form:
POSSIBLE SOLUTION: Remove the UNLOAD statement from the Paint event procedure or disable the combo box during the Unload event. 380 Invalid property valueAn inappropriate value is assigned to a property. To find out which values are valid for a property, see the property's Help topic.POSSIBLE SOLUTION: Compare valid settings in the property's Help topic to the setting you specified and reconcile. 381 Invalid property array indexYou tried to use an inappropriate property array index value. List property index values must be greater than 0 and less than 32,767. For example, the following is valid:
POSSIBLE SOLUTION:Change the array index to a value in the valid range. 382 Property can't be set at run timeThe following properties cannot be set at run time:
POSSIBLE SOLUTIONS:
383 Property is read-onlyThe following properties are read-only at design time and run time:Property Object
POSSIBLE SOLUTION:Change the property reference to read the value rather than set it. 384 Property can't be modified when form is minimized or maximizedThe Left, Top, Height, and Width properties cannot be changed on a minimized or maximized form.POSSIBLE SOLUTIONS:
385 Must specify index when using property arrayYou must specify an index when using the List property. Index values must be greater than 0 and less than 32,767. For example: >
This is invalid because no index is specified. However, the following is
valid because an index is specified:
POSSIBLE SOLUTION:Include an index specification with the List property. 386 Property not available at run timeThe CtlName and FormName properties are not available at run time.POSSIBLE SOLUTIONS:
387 Property can't be set on this control
POSSIBLE SOLUTION: Change your reference to the Checked, Separator, or Visible property to conform to the usage rules outlined above. 400 Form already displayed; can't show form modallyDon't use the SHOW method to display a modal form that is already visible.POSSIBLE SOLUTIONS:
401 Can't show non-modal form when modal form is displayedThis error occurs after a Form_Load event procedure attempts to make a non-modal form visible.POSSIBLE SOLUTION: Unload or hide the modal form before trying to use the SHOW method on another form. 402 Must close or hide topmost modal form firstThe modal form you tried to close or hide is not on top. A modal form is a form displayed by the SHOW method with the style% argument equal to 1.POSSIBLE SOLUTION: Unload or hide all modal forms that are on top of this one before you continue. 403 MDI form cannot be shown modallyA form with its FormType property set to 1 - MDI cannot be modal.POSSIBLE SOLUTIONS:
410 Property can't be modified on MDI formBecause an MDI form is always maximized, any property setting that attempts to change this status can also cause an error. Such properties include Top, Left, Width, and Height.POSSIBLE SOLUTION: Explicitly reference a non-MDI form when setting the value of this property. 420 Invalid object referenceThe referenced object is not loaded.POSSIBLE SOLUTION: Use the LOAD statement or SHOW method to load the specified object before referencing it. 421 Method not applicable for this objectYou tried to use a method that is not available for use with the specified object. For example, the following produces this error because the ADDITEM method is used only with a list or combo box control:
POSSIBLE SOLUTIONS:
422 Property not foundYou tried to reference a property that is not available for use with the specified control.POSSIBLE SOLUTIONS:
423 Property or control not foundYou tried to reference a control or property that is not defined for the specified form.POSSIBLE SOLUTIONS:
424 Object requiredYou referenced a property without including explicit reference to the active form or control.POSSIBLE SOLUTION: Change the property reference to explicitly include the active form or control name. 425 Invalid object useYou attempted an invalid assignment using a form or control. To assign a value to a property or a property value to a variable, remember to include the property name in the object specification. For example:
POSSIBLE SOLUTION:Include the property name in the object reference. 430 No currently active controlNo control has the focus, so the ActiveControl property has no effect.POSSIBLE SOLUTION: Use the SETFOCUS method to set the focus to a specified object. 431 No currently active formNo form has the focus, so the ActiveForm property has no effect.POSSIBLE SOLUTION: Use the SETFOCUS method to set the focus to an object. 480 Can't create AutoRedraw imageThere isn't enough memory available to create a persistent background image for an automatic redraw of the form or picture.POSSIBLE SOLUTIONS:
Unprintable errorAn error message is not available for the error condition that exists.POSSIBLE SOLUTION: An ERROR statement is using an error-code argument value for which Visual Basic has no error message string. Additional query words:
Keywords : |
Last Reviewed: December 2, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |