Course (4-2) MS Visual Basic for MS Access
- 1. Where VBA Fits In
- 1.1. Taking a Look at Access
- 1.2. Understanding VBA
- 1.3. Seeing Where VBA Lurks
- 1.3.1. Finding standard modules
- 1.3.2. Finding class modules
- 1.3.3. From VBA to Access
- 1.4. Finding Out How VBA Works
- 1.4.1. Discovering VBA procedures
- 1.4.2. Recognizing VBA procedures
- 2. Your VBA Toolkit
- 2.1. Using the Visual Basic Editor
- 2.1.1. Using Project Explorer
- 2.1.2. Using the Properties window
- 2.1.3. Using the Immediate window
- 2.1.4. Using the Code window
- 2.2. Referring to Objects from VBA
- 2.3. Setting References to Object Libraries
- 2.4. Using the Object Browser
- 2.5. Searching the Object Library
- 2.1. Using the Visual Basic Editor
- 3. Jumpstart: Creating a Simple VBA Program
- 3.1. Creating a Standard Module
- 3.2. Creating a Procedure
- 3.3. Understanding Syntax
- 3.3.1. Getting keyword help
- 3.3.2. Help with arguments
- 3.3.3. About named arguments
- 3.4. Using Existing Code
- 3.4.1. Copy and paste code from the Web
- 3.4.2. Importing modules
- 3.4.3. Modifying existing code
- 4. Understanding Your VBA Building Blocks
- 4.1. Commenting Your Code
- 4.2. Understanding VBA Data Types
- 4.3. Passing Data to Procedures
- 4.3.1. Storing data in variables and constants
- 4.3.2. Storing data in arrays
- 4.3.3. Module-level versus procedure-level
- 4.3.4. Naming conventions for variables
- 4.4. Repeating Chunks of Code with Loops
- 4.4.1. Using Do...Loop to create a loop
- 4.4.2. Using While...Wend to create a loop
- 4.4.3. Using For...Next to create a loop
- 4.5. Making Decisions in VBA Code
- 4.5.1. Using If...End If statements
- 4.5.2. Using a Select Case block
- 5. Controlling Access through VBA
- 5.1. Understanding Object Models
- 5.1.1. Distinguishing between objects and collections
- 5.1.2. Understanding properties and methods
- 5.1.3. Identifying the icons for objects, properties, and methods
- 5.2. Manipulating Properties and Methods
- 5.2.1. Getting the value of a property
- 5.2.2. Changing the value of a property
- 5.2.3. Using an object’s methods
- 5.2.4. Seeking help with properties and methods
- 5.1. Understanding Object Models
- 6. Programming Access Forms
- 6.1. Working with Class Procedures
- 6.2. Enabling or Disabling Form Controls
- 6.2.1. Using VBA to position the cursor
- 6.2.2. Choosing an object and event for the code
- 6.2.3. Showing and hiding controls
- 6.2.4. Making controls read-only
- 6.3. Responding to Form Events
- 6.4. Changing the Appearance of Objects
- 6.4.1. Changing colors
- 6.4.2. Controlling boldface, italics, and such
- 6.4.3. Changing special effects
- 6.4.4. Using the With...End With statements
- 6.4.5. Filling form controls with data
- 6.5. Opening and Closing Forms
- 6.5.1. Closing a form
- 6.5.2. Adding a related record to another table
- 6.5.3. More DoCmd methods for forms
- 7. The Scoop on SQL and Recordsets
- 7.1. What the Heck Is SQL?
- 7.1.1. Writing SQL without knowing SQL
- 7.1.2. Select queries versus action queries
- 7.1.3. Getting SQL into VBA
- 7.1.4. Hiding warning messages
- 7.1.5. Storing SQL statements in variables
- 7.2. Creating Tables from VBA
- 7.2.1. Creating new tables from existing tables
- 7.2.2. Creating a new, empty table from VBA
- 7.2.3. Closing and deleting tables through VBA
- 7.3. Adding Records to a Table
- 7.3.1. Appending a single record with SQL
- 7.3.2. Query to append one record
- 7.4. Changing and Deleting Table Records
- 7.5. Performing an Action Query on One Record
- 7.6. Working with Select Queries and Recordsets
- 7.6.1. Defining a connection
- 7.6.2. Defining the recordset and data source
- 7.6.3. Filling the recordset with data
- 7.6.4. Managing recordsets
- 7.6.5. Referring to fields in a recordset
- 7.6.6. Closing recordsets and collections
- 7.1. What the Heck Is SQL?
- 8. Putting Recordsets to Work
- 8.1. Looping through Collections
- 8.1.1. Using For Each loops
- 8.1.2. Using shorter names for objects
- 8.2. Tips on Reading and Modifying Code
- 8.2.1. Square brackets represent names
- 8.2.2. Other ways to refer to objects
- 8.2.3. The continuation character
- 8.3. Skipping Over Used Mailing Labels
- 8.4. Looking at How SkipLabels Works
- 8.4.1. Passing data to SkipLabels
- 8.4.2. Declaring variables
- 8.4.3. Copying the label report
- 8.4.4. Getting a report’s recordsource
- 8.4.5. Creating the recordset
- 8.4.6. Creating LabelsTempTable from MyRecordSet
- 8.4.7. Calling a Procedure from an Event
- 8.1. Looping through Collections
- 9. Creating Your Own Dialog Boxes
- 9.1. Displaying and Responding to Messages
- 9.1.1. Asking a question
- 9.1.2. Designing a message box
- 9.1.3. Responding to a MsgBox button click
- 9.2. Converting Forms to Dialog Boxes
- 9.2.1. Storing dialog box settings
- 9.2.2. Setting form properties
- 9.2.3. Adding controls to the dialog box
- 9.3. Creating Custom Combo Boxes
- 9.4. Creating a Spin Box Control
- 9.5. Detecting a Right-Click
- 9.1. Displaying and Responding to Messages
- 10. Customizing Combo Boxes and List Boxes
- 10.1. Programming Combo and List Boxes
- 10.1.1. Listing field names
- 10.1.2. Listing text options
- 10.1.3. Listing Table/Query field values
- 10.2. Linking Lists
- 10.2.1. Running code when a form opens
- 10.2.2. Running code when the user makes a choice
- 10.3. Linking Lists across Forms
- 10.3.1. Updating a combo box or a list box
- 10.3.2. Opening a form to enter a new record
- 10.3.3. Seeing whether a form is open
- 10.3.4. Getting forms in sync
- 10.4. More Combo Box Tricks
- 10.4.1. Using hidden values in combo and list boxes
- 10.4.2. Giving users a quick find
- 10.4.3. Avoiding retyping common entries
- 10.1. Programming Combo and List Boxes
- 11. Creating Your Own Functions
- 11.1. The Role of Functions in VBA
- 11.2. Creating Your Own Functions
- 11.2.1. Passing data to a function
- 11.2.2. Returning a value from a function
- 11.2.3. Testing a custom function
- 11.3. A Proper Case Function
- 11.3.1. Looking at how PCase( ) works
- 11.3.2. Using the PCase( ) function
- 11.4. A Function to Print Check Amounts
- 11.4.1. Using the NumWord function
- 11.4.2. Looking at how NumWord( ) works
- 12. Testing and Debugging Your Code
- 12.1. Understanding Compilation and Runtime
- 12.2. Considering Types of Program Errors
- 12.3. Conquering Compile Errors
- 12.3.1. Expected: expression
- 12.3.2. Expected: end of statement
- 12.3.3. Expected: list separator or )
- 12.4. Dealing with Logical Errors
- 12.4.1. Checking on variables with Debug.Print
- 12.4.2. Slowing down code
- 12.4.3. Getting back to normal in the Code window
- 12.5. Wrestling Runtime Errors
- 12.5.1. Responding to a runtime error
- 12.5.2. Trapping runtime errors
- 12.5.3. Writing your own error handlers
- 13. Using VBA with Multiple Databases
- 13.1. Client-Server Microsoft Access
- 13.2. Importing from External Databases
- 13.3. Linking to External Data through Code
- 13.4. Avoiding Multiple Tables and Links
- 13.5. Creating Recordsets from External Tables
- 13.6. Importing, Exporting, or Linking to Anything
- 13.6.1. Using a macro to write the code
- 13.6.2. Quick and easy import/export/link
- 14. Integrating with Other Office Applications
- 14.1. Accessing the Object Library
- 14.1.1. Exploring a program’s object model
- 14.1.2. Meet the Application object
- 14.1.3. Connecting to other programs
- 14.2. Sending E-Mail via Outlook
- 14.3. Sending Data to Microsoft Word
- 14.3.1. Creating the Word template
- 14.3.2. Creating the Access form
- 14.3.3. Writing the merge code
- 14.4. Interacting with Microsoft Excel
- 14.4.1. Creating the worksheet
- 14.4.2. Creating a query and a form
- 14.4.3. Writing the Excel code
- 14.4.4. Copying a table or query to a worksheet
- 14.4.5. Running Excel macros from Access
- 14.1. Accessing the Object Library
- 15. Ten Commandments of Writing VBA
- 15.1. I. Thou Shalt Not Harbor Strange Beliefs about Microsoft Access
- 15.2. II. Thou Shalt Not Use VBA Statements in Vain
- 15.3. III. Remember to Keep Holy the VBA Syntax
- 15.4. IV. Honor Thy Parens and Quotation Marks
- 15.5. V. Thou Shalt Not Guess
- 15.6. VI. Thou Shalt Not Commit Help Adultery
- 15.7. VII. Thou Shalt Steal Whenever Possible
- 15.8. VIII. Thou Shalt Not Bear False Witness against Thy Object Browser
- 15.9. IX. Thou Shalt Not Covet Thy Neighbor’s Knowledge
- 15.10. X. Thou Shalt Not Scream
- 16. Top Ten Nerdy VBA Tricks
- 16.1. Open a Form from VBA
- 16.2. See Whether a Form Is Already Open
- 16.3. Refer to an Open Form
- 16.4. Move the Cursor to a Control
- 16.5. Change the Contents of a Control
- 16.6. Update a List Box or Combo Box
- 16.7. Show a Custom Message
- 16.8. Ask the User a Question
- 16.9. Print a Report
- 16.10. Get to Know the DoCmd Object
Online LIVE Training Programming Course offered by INCAPROG ONLINE - www.incaprog.com - contacto@incaprog.com - Phone : (954) 727-3141