Bands Submit Private Sub btnSubmit_Click() Dim band As String

Slides:



Advertisements
Similar presentations
Chapter 6 - VB 2005 by Schneider1 Do Loop Syntax Do While condition statement(s) Loop Condition is tested, If it is True, the loop is run. If it is False,
Advertisements

CS 4 Intro to Programming using Visual Basic Do Loops Patchrawat Uthaisombut University of Pittsburgh 1 based on lecture notes by D. Schneider.
Quiz 2. Quiz 2 What is output (5 Marks) [8 min] X = 987 Y = X Z = 0 Do Do While (Y > 0) Z = Z + Y Mod 10 Y = Y \ 10 Loop Y = Z Z = 0 Loop Until (Y < 10)
1 Loops zDo While Loop: yRepeats a block of code WHILE a condition remains TRUE Do While condition Code to execute Loop.
Chapter seven review. What is the output of: Private Sub cmdButton_Click() Dim i As Integer, a(1 To 4) As integer Open "DATA.TXT" For Input As #1 For.
More on lists, exceptions, loops and validation. You can use the exception to indicate the error that occurred Private Sub btnCheck_Click(ByVal sender.
Data Types and Operations Programming Fundamentals (Writing Code)Programming Fundamentals (Writing Code)
VB Code Statements 3 types of VB statement The Remark statement, known as comments, are used for project documentation only Begin with an apostrophe Not.
Arrays. What is the output of: Private Sub cmdButton_Click() Dim i As Integer, a(1 To 4) As integer Open "DATA.TXT" For Input As #1 For i = 1 To 4 Input.
VBA & Excel Barry L. Nelson IEMS 465 Fall Quarter 2003.
Muffin Shop - if, calculations etc. (muffins, muffins2) Please use speaker notes for additional information!
IN THE NAME OF ALLAH UserForms on VBA Lab 06 Tahani Al_dweesh.
Week 8.  Recap  User Forms  Input Validation Message Boxes Input Boxes  Conversion Functions.
Chapter 7 Code Tables. VB Code Box 7-1 Event Procedure for Compute Button Private Sub hsbExemptions_Change() txtExemptions.Text =Str(hsbExemptions.Value)
Microsoft Access Using Visual Basic Routines. Visual Basic Datatypes Boolean Byte Currency Date Double Integer Long Object Single String Variant Hyperlink.
Programming Test #1 Solutions. Multiple Choice 1. B) the grammar of the coding language 2. C) String 3. A) Single 4. C) 2Burgers4Me 5. B) Design Time.
Component 4/Unit 5-4. Iteration (Repetition, Looping, Do loops) Loops are used to execute statements repetitively Loops require a conditional test that.
Do Loop with Interest Please see speaker notes for additional information!
Visual Basic CODE. Basics of Code Declaration Declaration Set aside a named place to put things Set aside a named place to put things Assignment Assignment.
# 1# 1 CS 105 Spring 2010 Macros: Sub Procedures You Record What is a macro? What is With…End With? What is Sub…End Sub? Relative vs. Absolute.
OV Copyright © 2011 Element K Content LLC. All rights reserved.  Insert Text  Format Text  Sort Data  Duplicate Data  Generate a Report Formatting.
1 Flow Control II Code: Select-Case and For-Next Controls: Frames and OptionButtons.
Week 4.  Recap – Ranges  For Each Loops  Ranges Referencing Range Objects  Set (keyword)
Statements That Repeat. For...Next Loop Structure For counter = start To end Step increment statements Next counter Where Counter is tested to see if.
Visual Basic Programming Making Decisions: Loops & Decision Structures ©Copyright by Ronald P. Kessler, Ph.D.
6c – Function Procedures Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
Overview of VBA Programming & Syntax. Programming With Objects u Objects –Properties: attributes or characteristics of an object (e.g., font size, color,
Repetition Structures
CW-V1 SDD 0901 Principals of Software Design and Development Loops Starter: Water JugsWater Jugs.
VAT Calculator program Controls Properties Code Results.
Pay Example (PFirst98) Please use speaker notes for additional information!
User Defined Data Types The Type Statement. Creating Your Own Data Types You can combine variables of several different types to create user-defined types.
Created by Alia Al-Abdulkarim 2008 Visual Basic Vs. Java.
VBA Navigation, Conditionals, and Boxes. VBA Navigation.
ME 142 Engineering Computation I Input, Output & Documentation.
Controlling Program Flow with Looping Structures
مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.
Using a Database Access97 Please use speaker notes for additional information!
MIC305 Week 6 Beyond controls Review of properties Differences with VB6: using classes and instances Programming constructs.
ADO and DataList, DataCombo and DataGrid Controls Please use speaker notes for additional information!
Ch. 101 DataTable (Continue) Lab sheet 10.3: Form Display Cities table along with percentage growth.
Chapter 6 Controlling Program Flow with Looping Structures.
Multiple forms - SDI & MDI Please use speaker notes for additional information!
Contact Us.
A variable is a name for a value stored in memory.
Repetition – For and Do While
Even More VBA IE 469 Spring 2017.
Phone: + 40 (728) | +40 (733)
How To Add A Xerox Printer To Google Chrome
Frio River Cabins - Frio Vacation Homes - Frio Country Resort
Learning Excel Session 9 and 10 Dr. Chaitali Basu Mukherji.

مراجعة الحاسب.
Department Array in Visual Basic
حلقات التكرار.
البرمجة بلغة الفيجول بيسك ستوديو
البرمجة بلغة فيجول بيسك ستوديو
Chapter (3) - Looping Questions.
Part 3 Saving (without the Save button)
Dictionary Builder Part 4 Loading Files.
Active-X Calendar Control
Visual Basic Programming
Dictionary Builder Part 1 Getting Started.
VB.Net Programming Console Application
GCSE Computing:: Selection (IF statements)
Firebase Vs. MongoDB: Choose the Best Database of 2019
Repetition - Counting and Accumulating
Sub 範例 Sub F ( X ) MsgBox(X ^ 2 ) End Function
Meet Us
Contact Us
Presentation transcript:

Bands Submit Private Sub btnSubmit_Click() Dim band As String Dim Addr1 As String Dim Addr2 As String Dim Town As String Dim City As String Dim Postcode As String Dim Contact As String Dim Cost As Currency band = Me.txtBandName.Text Addr1 = Me.txtAddr1.Text Addr2 = Me.txtAddr2.Text Town = Me.txtTown.Text City = Me.txtCity.Text Postcode = Me.txtPostcode.Text Contact = Me.txtContact.Text Cost = CCur(Me.txtCost.Text) Sheets("Bands").Activate Range("A2").Select Do While IsEmpty(ActiveCell) = False ActiveCell.Offset(1, 0).Select Loop ActiveCell.Value = band ActiveCell.Offset(0, 1).Value = Addr1 ActiveCell.Offset(0, 2).Value = Addr2 ActiveCell.Offset(0, 3).Value = Town ActiveCell.Offset(0, 4).Value = City ActiveCell.Offset(0, 5).Value = Postcode ActiveCell.Offset(0, 6).Value = Contact ActiveCell.Offset(0, 7).Value = Cost Sheets("Menu").Select Unload Me End Sub Bands Submit

Venues Submit Private Sub btnVSubmit_Click() Dim Venue As String Dim Addr1 As String Dim Addr2 As String Dim Town As String Dim County As String Dim Postcode As String Dim Phone As String Dim Max As Integer Dim Cost As Currency Venue = Me.txtVName.Text Addr1 = Me.txtVAddr1.Text Addr2 = Me.txtVAddr2.Text Town = Me.txtVTown.Text City = Me.txtVCounty.Text Postcode = Me.txtVPostcode.Text Phone = Me.txtVPhone.Text Cost = CCur(Me.txtVCost.Text) Max = CInt(txtVCapacity.Text) Sheets("Venues").Activate Range("A2").Select Do While IsEmpty(ActiveCell) = False ActiveCell.Offset(1, 0).Select Loop ActiveCell.Value = Venue ActiveCell.Offset(0, 1).Value = Addr1 ActiveCell.Offset(0, 2).Value = Addr2 ActiveCell.Offset(0, 3).Value = Town ActiveCell.Offset(0, 4).Value = County ActiveCell.Offset(0, 5).Value = Postcode ActiveCell.Offset(0, 6).Value = Phone ActiveCell.Offset(0, 7).Value = Max ActiveCell.Offset(0, 8).Value = Cost Sheets("Menu").Select Unload Me End Sub Venues Submit

Lighting Technicians Submit Private Sub btnLSubmit_Click() Dim Company As String Dim Amount As Integer Dim Cost As Currency Company = Me.txtLCompany.Text Amount = CInt(Me.txtLAmount.Text) Cost = CCur(Me.txtLCost.Text) Sheets("Lighting Technicians").Select Range("A4").Select Do While IsEmpty(ActiveCell) = False ActiveCell.Offset(1, 0).Select Loop ActiveCell.Value = Company ActiveCell.Offset(0, 1).Value = Amount ActiveCell.Offset(0, 2).Value = Cost Sheets("Menu").Select Unload Me End Sub Lighting Technicians Submit

Sound Technicians Submit Private Sub btnSSubmit_Click() Dim Company As String Dim Amount As Integer Dim Cost As Currency Company = Me.txtSCompany.Text Amount = CInt(Me.txtSAmount.Text) Cost = CCur(Me.txtSCost.Text) Sheets("Sound Technicians").Select Range("A4").Select Do While IsEmpty(ActiveCell) = False ActiveCell.Offset(1, 0).Select Loop ActiveCell.Value = Company ActiveCell.Offset(0, 1).Value = Amount ActiveCell.Offset(0, 2).Value = Cost Sheets("Menu").Select Unload Me End Sub Sound Technicians Submit

User form - Initialise Private Sub UserForm_Initialize() Me.txtBandName.Text = "" Me.txtAddr1.Text = "" Me.txtAddr2.Text = "" Me.txtTown.Text = "" Me.txtCity.Text = "" Me.txtPostcode.Text = "" Me.txtContact.Text = "" Me.txtCost.Text = 0 Me.txtVName.Text = "" Me.txtVAddr1.Text = "" Me.txtVAddr2.Text = "" Me.txtVTown.Text = "" Me.txtVCounty.Text = "" Me.txtVPostcode.Text = "" Me.txtVPhone.Text = "" Me.txtVCost.Text = 0 Me.txtVCapacity.Text = 0 Me.txtLCompany.Text = "" Me.txtLAmount.Text = 0 Me.txtLCost.Text = 0 Me.txtSCompany.Text = "" Me.txtSAmount.Text = 0 Me.txtSCost.Text = 0 End Sub User form - Initialise

Clear Buttons Private Sub btnClear_Click() Me.txtBandName.Text = "" Me.txtAddr1.Text = "" Me.txtAddr2.Text = "" Me.txtTown.Text = "" Me.txtCity.Text = "" Me.txtPostcode.Text = "" Me.txtContact.Text = "" Me.txtCost.Text = 0 Me.txtBandName.SetFocus End Sub Private Sub btnVClear_Click() Me.txtVName.Text = "" Me.txtVAddr1.Text = "" Me.txtVAddr2.Text = "" Me.txtVTown.Text = "" Me.txtVCounty.Text = "" Me.txtVPostcode.Text = "" Me.txtVPhone.Text = "" Me.txtVCost.Text = 0 Me.txtVCapacity.Text = 0 Me.txtVName.SetFocus Private Sub btnLClear_Click() Me.txtLCompany.Text = "" Me.txtLAmount.Text = 0 Me.txtLCost.Text = 0 Me.txtLCompany.SetFocus Private Sub btnSClear_Click() Me.txtSCompany.Text = "" Me.txtSAmount.Text = 0 Me.txtSCost.Text = 0 Me.txtSCompany.SetFocus Clear Buttons

Cancel Buttons Private Sub btnCancel_Click() Unload Me End Sub Private Sub btnVCancel_Click() Private Sub btnLCancel_Click() Private Sub btnSCancel_Click()