Upwork Test Answers: Get all the correct answers of most recent and possible Upwork Tests A to Z (Updated on Jan, 2016)
Cover Letter Templates: These cover letter samples are not only for Upwork job, but also you will have some idea about your real life job
 
Freelance Profile Overviews: Different Profile samples and overviews of experts, advanced and intermediate level freelancers
For Newbie of Upwork: Upwork Help - How to apply for a job in Upwork with 10 most important articles about Upwork

A to Z View - All Upwork Test Answers

Visual Basic Test Answers (new)

Visal Basic is an Application of Microsoft Technologies which has been released 1991 and declared legacy in 2008. It is third generation object-oriented computer programming language. Microsoft intended Visual Basic to be relatively easy to learn and use.

Here in this post you will find most recent Upwork test questions and answers of Visual Basic test for Upwork Microsoft Technologies category. Search your desired answers of the test questions by pressing Ctrl + F button.
--------------------------------------------------------------------------------------------------------------------------


1. Which of the following is the valid stepping option?
 Answers: • Step Behind or • Step forward or • Step Into

 2. Which of the following procedure types will execute when you assign a value to a property of an object?
 Answers: • Property Assign

 3. Which line of code listed here can be used to create a string of fixed length:
 Answers: • None of the above

 4. Which event of an ActiveX control data provider runs every time a bound control extracts data through the provider?
 Answers: • RetrieveData

 5. Which property of the Err object returns the numeric value associated with the most recent runtime error?
 Answers: • Number

 6. Which function or method will you use to get a count of the maximum index limit of an array?
 Answers: • UBound function

 7. Which is the only event of the timer control?
 Answers: • Timer

 8. What you must do before you make calls to an ActiveX DLL project in the same Project Group?
 Answers: • Check the DLL off in your project's Reference List

 9. The _______ property changes the tab order at runtime:
 Answers: • Tab index

 10. Message Boxes can hold a maximum of _______ characters.
 Answers: • 1024

 11. Procedures declared in a _____ are local whereas procedures declared in a ______ are available to the whole application.
 Answers: • Form window, standard or code module

 12. To store pictures in an array, Visual Basic provides the _____ control.
 Answers: • ImageList

 13. Which of the following situations would not cause the Initialize event of an ActiveX control to occur?
 Answers: • When a control is placed on a form at design time

 14. The settings for the Color properties in Visual Basic are indicated by:
 Answers: • Hexadecimal Coding

 15. You want to display the code and the description of an error. What would be the correct syntax?
 Answers: • Msgbox err.number & err.description

 16. The Load & Activate events are associated with:
 Answers: • Form

 17. How do you create a read only property in a form?
 Answers: • Create only a Property Get procedure

 18. In Visual Basic, which method can you use to send key strokes to other Window applications?
 Answers: • SendKeys

 19. Which of the following will provide the best aggregate performance for a query that is not executed repeatedly?
 Answers: • Direct execution

 20. Which of the following is an event of the Shape control?
 Answers: • A shape control does not have events

 21. Labels do not respond to _____ and ______ events.
 Answers: • Got_Focus , Lost_Focus

 22. The ____ function returns the numeric value from a string expression:
 Answers: • Val

 23. Which of the following tools can be used to change the value of a variable or property during break mode of an application?
 Answers: • Locals window

 24. What data type is the HelpContextID?
 Answers: • Integer

 25. The Kill command in Visual Basic is used for:
 Answers: • Deleting files

 26. A prepared statement is:
 Answers: • Query text cached on the client

 27. Which of the following statements should you write to cause the component to fire an event?
 Answers: • RaiseEvent

 28. Which of the following locking types will lock a recordset only during an Update process and not immediately when the data modifications are requested?
 Answers: • Batch optimistic

 29. What is the extension of the Visual Basic project file that stores the design of a user control.
 Answers: • .ctl

 30. You are creating a client application that calls ActiveX DLLs. Which of the following properties of the Err object provides the name of a component that sends an error back to the client application?
 Answers: • Source

 31. Consider the following program code:

 (i) Dim FileName as String
 Open FileName For Input As #FreeFile

 (ii) Dim FileName as String
 FileNum = FreeFile
 Open FileName For Input As #FileNum
 Answers: • Only (i) is correct

 32. Variables that allow sharing of values across event procedures are called:
 Answers: • Module level variable

 33. Which property of the form changes the form's title?
 Answers: • Caption

 34. The event Lost_Focus of one object results in _____ of the other object:
 Answers: • Mouse_click

 35. How do you make a control gray and inaccessible in VB?
 Answers: • Set enabled to false

 36. To destroy an object and free the memory space occupied by it, the keyword used is:
 Answers: • Nothing

 37. Which of the following methods is used to inform an ActiveX control's container that one of its properties has been modified?
 Answers: • PropertyChanged

 38. Which of the following is the only valid Resume statement in an error handler?
 Answers: • Resume next

 39. If the CancelError Property of the CommonDialog Box is set to true then which of the following statement is true:
 Answers: • None of the above

 40. In order to enable the DBGridControl or the MSFlexGrid Control to display the contents of a table or query, you need to set only the ______ property:
 Answers: • DataSource

 41. One can convert a Visual Basic Application into ActiveX Document using:
 Answers: • ActiveX Document Migration Wizard

 42. Which event of a text box would you use for validating the data entered by the user?
 Answers: • Validate

 43. Which events enable you to determine which key was pressed by the user?
 Answers: • KeyPress, KeyUp and KeyDown

 44. Which event occurs only once in the entire life cycle of an ActiveX control?
 Answers: • Initialize

 45. Only Controls with a ________ property such as Picturebox, Toolbox, Statusbar etc. can be placed on an MDI form:
 Answers: • BorderStyle = 0

 46. The _______ function enables a VB application to make use of the idle time and to respond periodically to events.
 Answers: • DoEvents

 47. How many root nodes can a TreeView control have?
 Answers: • No limit

 48. In order to overlap the controls (say a command button) during design time, we use the 'Send To Back' or 'Bring To Front' option from the Edit menu. To change it dynamically (i.e. during program execution) we need to change:
 Answers: • ZOrder property

 49. What is the default value for the scalemode property of the form?
 Answers: • Twip

 50. Which of the following ADO recordset types provides the greatest degree of concurrency?
 Answers: • Dynamic

 51. Which collection of an ActiveX control enumerates all of the properties that can be bound to a data source?
 Answers: • DataFields

 52. Which object is used for error handling?
 Answers: • Err

 53. The _______ property enables Visual Basic to draw complete images in memory before displaying them on the Screen.
 Answers: • AutoRedraw = True

 54. Which event should be used to resize an ActiveX control as the user modifies the size of the control implementation on a form?
 Answers: • Resize

 55. Which event is fired when a text box loses focus?
 Answers: • LostFocus

 56. Which of the following approaches to data modifications is the least efficient?
 Answers: • An update statement executed directly

 57. How can you keep the user from exiting a form by clicking the Close button?
 Answers: • Place code in the Unload event

 58. In order to provide a transparent background to the Form, you must change the _________ property to _______.
 Answers: • BackStyle, Transparent

 59. What do CurrentX and CurrentY return?
 Answers: • Current X and Y co-ordinates of mousepointer

 60. Which property of the ProgressBar determines how much of the bar is filled?
 Answers: • CurrentVal

 61. The _______ method loads the form named 'Form1' in to memory and also displays it.
 Answers: • Form1.Show

 62. Which of the following cannot be included in the Open method of the recordset?
 Answers: • User Name

 63. The caption and the name properties of the command button:
 Answers: • Can be different at times

 64. Which of the following statements forces inline error handling?
 Answers: • None of the above

 65. Which of the following debug tools would you use to locate your current position in a series of embedded procedure calls?
 Answers: • Callstack

 66. Which of the following can be shown to the user using the Common Dialog control in VB?
 Answers: • Open dialog box

 67. Consider the following subprogram:

 Sub ChangeText(ByVal X as String,Y as String)
 Y = X
 End Sub


 If you are calling it using the following code:

 Call ChangeText(Form1.Caption,Y$)
 Answers: • The Caption of Form1 will not change

 68. Visual Basic fires the _______ event everytime a part of the form is newly exposed.
 Answers: • Paint

 69. What does the forms collection contain?
 Answers: • A list of all forms in a project

 70. You try to initialize a new Object variable with the following line but receive an error. What could be the possible cause?

 Set MyVar = New Classname
 Answers: • You do not have the permission to access the class

 71. What is the sequence of events when a form is unloaded?
 Answers: • Unload only

 72. In order to change the mouse pointer shape from glass to watch-glass, the property to be used is:
 Answers: • MousePointer

 73. The _______ method resets the contents of bound controls to their original values when the user clicks on the cancel button.
 Answers: • UpdateControls

 74. Which of the following are not properties of Command Button:
 Answers: • Multi-Line

 75. Which form event would you use to activate a pop-up menu when the user clicks the right mouse button?
 Answers: • MouseUp

 76. What does the controls collection contain?
 Answers: • A list of all controls on a form

 77. The interval property of the Timer control specifies the time in:
 Answers: • Milliseconds

 78. Which of the following compiled elements does not run in process?
 Answers: • Standard DLL

 79. Which method will you use to remove a form from the Screen but retain it in memory?
 Answers: • Show method

 80. Global Procedures and Global Variables are declared in:
 Answers: • Standard (Code) Modules

 81. What is the sequence in which the following events are triggered when a form is loaded?
 Answers: • Initialize, Load, Resize and Paint

 82. An ADO dynamic property is:
 Answers: • A property that changes value at runtime

 83. Which event is triggered when the user moves to another open form?
 Answers: • Deactivate

 84. Which event procedure is called only if AutoRedraw property is set to false:
 Answers: • Form_Paint

 85. If one needs to use an ampersand(&) in a Label but does not want it to be an Access Key, the _______ property of the label must be set to False.
 Answers: • Locked

 86. In order to access a file in Non-textual format, you have to open file in:
 Answers: • Binary Format

 87. Which three methods does the collection object support?
 Answers: • Add, Remove, Item

 88. The vbCritical symbol displays:
 Answers: • A critical message icon

 89. To save a file in a RichTextBox Control and a picture in a Picture Box Control, you will use the _________ and __________ statements, respectively:
 Answers: • RichText1.SaveFile, Picture1.SavePicture

 90. The ______ property is used to show Tool Tips or Help Balloons when the mouse rests on the object:
 Answers: • ToolTipText

 91. To deactivate the Form UnLoad event, you make the following change in the function definiton:

 Private Sub Query_Unload(Cancel as Integer,UnloadMode as Integer)

 To prevent the Form from closing, you will set the:
 Answers: • Cancel parameter to a non-zero value

 92. Which line of the following code contains an error?

 1 public Sub Command1_Click()
 2 Dim str As String
 2 str = "Hello World"
 3 i = val (str)
 4 length = strlen(str)
 5 Msgbox "No Of Characters in " & str & " = " & CSstr(length)
 6 End Sub
 Answers: • Error on line 3

 93. Visual Basic displays information depending upon the current value of two properties of the form, called as:
 Answers: • LeftX and LeftY

 94. After a Dynaset type recordset has been created and opened, further searching is possible using the:
 Answers: • FindNext method

 95. What is the purpose of the Class Builder add-in in Visual Basic:
 Answers: • To create new classes and define their properties, methods & events

 96. Which events allow you to determine if a Control or Shift key was pressed by the user?
 Answers: • KeyPress, KeyUp and KeyDown

 97. You can create menus by the ________ and _________.
 Answers: • Menu Editor, Application Wizard

 98. The ______ function can be used to run any .com, .exe, .bat or .pif file from a Visual Basic program.
 Answers: • Shell