Active-X Calendar Control

Slides:



Advertisements
Similar presentations
Decision making in VBA. Current Event Occurs: When a form is opened When the focus leaves one record and moves to another Before the first or next record.
Advertisements

Systems Development Group Project Programming Access Forms.
DATA Control. Data Control caption Get first Get previous Get next Get last.
Input Validation Check the values entered into a text box before beginning any calculations Validation is a form of ‘self-protection’, rejecting bad data.
Muffin Shop - if, calculations etc. (muffins, muffins2) Please use speaker notes for additional information!
3/9/2004 PPCC - Introduction to VB6 Copyright ©2004, Tore Bostrup 1 Introduction to VB6 Week 2.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
© 1999, by Que Education and Training, Chapter 5, pages of Introduction to Computer Programming with Visual Basic 6: A Problem-Solving Approach.
Private Sub Close_Click() On Error GoTo Err_Close_Click DoCmd.Close Exit_Close_Click: Exit Sub Err_Close_Click: MsgBox Err.Description Resume Exit_Close_Click.
VBA Form Techniques. Open a form from another form Private Sub cmdSupplierForm_Click() DoCmd.OpenForm "frmSupplierDetails" End Sub Code in Standard module.
Saeed Ghanbartehrani Summer 2015 Lecture Notes #4: Working with Variables and User Interfaces IE 212: Computational Methods for Industrial Engineering.
Ch 11: Userforms CP212 Winter Topics Designing User Forms o Controls Setting Properties o Tab Order o Testing Writing Event Handlers o Userform_Initialize.
JavaScript Lecture 6 Rachel A Ober
Chapter 7 Code Tables. VB Code Box 7-1 Event Procedure for Compute Button Private Sub hsbExemptions_Change() txtExemptions.Text =Str(hsbExemptions.Value)
Let’s get started using Visual Basic!. Private Sub cmdGo_Click... Dim strMessage As String Dim sngSum As Single If IsNumeric(txtNumber1.Text) = False.
ENGR 112 Decision Structures.
VB Core II Conditional statements Exception handling Loops Arrays Debugging.
1 Flow Control II Code: Select-Case and For-Next Controls: Frames and OptionButtons.
MS Visual Basic Applications Walter Milner. Event-driven programming Standard approach for GUIs Contrast with old character interfaces – program determines.
Arrays1 From time to time an object (a variable, a picture, a label or a command) does not serve as well as a set of objects of a similar kind addressed.
Sanjay Johal. Introduction(1.1) In this PowerPoint I will be explaining :  The purpose of the code for each of the two given programs, e.g. to carry.
VB for applications. Lesson Plan Fundamentals of VB VB for handling events in Access.
LOAN APPLICATION Income High Medium Low Employment References Employed Unemployed Good Bad Education High Low High Low Grant Investigate Further Investigate.
Copyright © 2001 by Wiley. All rights reserved. Chapter 6: Using Arrays Control Arrays List Arrays Finding Items in Arrays Multiple Forms 2-Dimensional.
1 Scripting Languages VBScript - Recognized mainly by Internet Explorer only - Netscape does have a plug-in JavaScript - Recognized by Internet Explorer.
VAT Calculator program Controls Properties Code Results.
Pay Example (PFirst98) Please use speaker notes for additional information!
Visual Basic I/O Programs (ProjRead1, ProjRead2, ProjWrite1, ProjPay) Please use speaker notes for additional information!
Chapter 4 Getting Started with VBA. Subroutines Subroutine is the logical section of code that performs a particular task. Subroutine is also called a.
CECS 5020 Computers in Education Visual Basic Variables and Constants.
31/01/ Selection If selection construct.
Word Processor Version.01 EME 4411 Week 5. The Scroll Bars.
Scope Lifetime Modules Procedures. Scope? Where can your variables be seen? Where used? Where abused (reseting the value)? Local and Global = Private.
DATA TYPES, VARIABLES AND CONSTANTS. LEARNING OBJECTIVES  Be able to identify and explain the difference between data and information  Be able to identify,
Visual Basic. The Close Method The Close method is used to close a form. To close a form use the keyword Me to refer to the form. Me.Close()
Using a Database Access97 Please use speaker notes for additional information!
Adding Code to the Option Button. Open VB 1.Double click the Calculate button and select General from the Object list box. 2.Add the following code to.
CheckBox i Option Button. Private Sub Command1_Click() Check1 = 1 If Check1 = 1 Then Text1.FontBold = True Else Text1.FontBold = False End If Check2 =
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 11 So Many Paths … So Little Time.
Knowledge Base. Defining a Variable Dim statement Dim intXX As Integer Public in a Module Public dblNN As Double.
Visual Basic Declaring Variables Dim x as Integer = 0 In the statement above, x is being declared as an Integer (whole number) and is initialised.
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
Multiple forms - SDI & MDI Please use speaker notes for additional information!
Use TryParse to Validate User Input
Visual Basic Fundamental Concepts
IE 8580 Module 4: DIY Monte Carlo Simulation
Edit a Public Holiday – Holiday Calendar
Use TryParse to Validate User Input
3rd prep. – 2nd Term MOE Book Questions.
CSI 101 Elements of Computing – Spring 2009
User Forms.
CHAPTER FIVE Decision Structures.
للمزيد زورونا على موقعنا الإلكتروني:
CS 3870/CS 5870 Web User Controls Events (II).
Visual Basic..
Tutorial 12 – Security Panel Application Introducing the Select Case Multiple-Selection Statement Outline Test-Driving the Security Panel Application.
Department Array in Visual Basic
حلقات التكرار.
البرمجة بلغة الفيجول بيسك ستوديو
البرمجة بلغة فيجول بيسك ستوديو
المحاضرة السادسة.
Chapter (3) - Looping Questions.
Do … Loop Until (condition is true)
CheckBox i Option Button
Data Types List Box Combo Box Checkbox Option Box Visual Basic 6.0
Additional Topics in VB.NET
Final Revision sheet- term2
Final Revision sheet- term2
Repetition - Counting and Accumulating
Sub 範例 Sub F ( X ) MsgBox(X ^ 2 ) End Function
Presentation transcript:

Active-X Calendar Control

Code to set dates Private Sub Form_Open(Cancel As Integer) ' set button caption when form opens cmdSetDate.Caption = "Set beginning date“ End Sub Private Sub cmdSetDate_Click() If cmdSetDate.Caption = "Set beginning date" Then txtBeginDate = calSelectDate.Value cmdSetDate.Caption = "Set ending date" Else txtEndDate = calSelectDate.Value cmdSetDate.Caption = "Set beginning date" End If End Sub

Code to preview report Private Sub cmdPrev_Click() Dim strRptName As String strRptName = "rptOrders" DoCmd.OpenReport strRptName, acViewPreview End Sub

Check for valid date entry ' check that end date is > begin date If txtEndDate < txtBeginDate Then MsgBox "The ending date must be later than the beginning date" cmdSetDate.Caption = "Set ending date" calSelectDate.SetFocus Exit Sub End If ' check that value entered for begin date If IsNull(txtBeginDate) Then MsgBox "You must enter a beginning date" cmdSetDate.Caption = "Set beginning date" ' check that value entered for end date If IsNull(txtEndDate) Then MsgBox "You must enter an ending date" Include this code in Click Event handler for Preview and Print Buttons

Report No Data Event Private Sub Report_NoData(Cancel As Integer) Cancel = MsgBox("No orders to display in range specified. Cancelling report...", _ vbInformation, _ Me.Caption) End Sub

Check whether form is open before running report Private Sub Report_Open(Cancel As Integer) If Not FormIsloaded("frmPrintOrders") Then Cancel = MsgBox("To preview or print this report you need to select dates from the Print Orders form. Open form?", vbOKCancel, Me.Caption) If Cancel = vbOK Then DoCmd.OpenForm "frmPrintOrders" End If End Sub

FormIsLoaded function Public Function FormIsloaded(strFrmName As String) As Boolean Const conFormDesign = 0 Dim intI As Integer FormIsloaded = False For intI = 0 To Forms.Count - 1 If Forms(intI).FormName = strFrmName Then If Forms(intI).CurrentView <> conFormDesign Then FormIsloaded = True Exit Function End If Next End Function