AccessVBA Programming for Beginners Class 3 - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

AccessVBA Programming for Beginners Class 3

Description:

A Static variable retains its value between calls to the procedure as long as the form is open. ... Very useful for maintaining counters within a local procedure. ... – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 10
Provided by: patric126
Category:

less

Transcript and Presenter's Notes

Title: AccessVBA Programming for Beginners Class 3


1
Access VBA Programmingfor Beginners - Class 3 -
  • by
  • Patrick Lasu
  • p_lasu_at_lycos.com

2
Class 3 - Overview
  • Static Variables
  • Message box
  • Input Box

3
Static Variables
  • A Static variable retains its value between calls
    to the procedure as long as the form is open.
  • Syntax Static varname As Type
  • Very useful for maintaining counters within a
    local procedure.
  • Example Static intCount As Integer

4
Message Box
  • A Message box is a handy tool to communicate with
    the user
  • Gives information to the user
  • Accepts user input
  • There are many pre-set constants that makes the
    Message box very versatile
  • Many times there is no need to create a custom
    Message box

5
Message Box
  • Syntax MsgBox(prompt, buttons , title ,
    helpfile, context)
  • Prompt The message text
  • Buttons Optional OK is default
  • Title Optional The text in the blue bar
  • Starting and closing parentheses ( ) are required
    only if you are receiving user input
  • Return value is an integer between 1 and 7

6
Input Box
  • Are useful if you want to receive input from a
    user
  • Not as flexible as Message boxes
  • Has a very plain look
  • Accepts user input with either OK or Cancel
    buttons
  • Not possible to distinguish between an empty
    user input or selecting Cancel
  • It is possible to control it with code Future
    Class!!!

7
Input Box
  • Syntax InputBox(prompt, title , default ,
    xpos , ypos , helpfile, context)
  • Prompt Message to the user
  • Title Optional - The text in the blue bar
  • Default Optional - Default value provided to
    the user
  • NOTE Returns a String value of user input

8
Review of Class 3
  • Static variables are good for keeping count in a
    local procedure
  • Message boxes are very versatile
  • Use them often
  • Input boxes are useful for user input
  • Not the greatest, but it works

9
Next Class
  • Variable Conversion
  • IF Statements
  • IIF Statements
  • Select Case Statements
Write a Comment
User Comments (0)
About PowerShow.com