Preview

Visual Basic Connection to MS Access

Satisfactory Essays
Open Document
Open Document
1691 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Visual Basic Connection to MS Access
MICROSOFT ACCESS

Database Name: db1
Table Name: Table1

VISUAL BASIC

Form Name: frmmain

Code:

Private Sub cmdadd_Click() frmadd.Show End Sub

Private Sub cmdexit_Click()
End
End Sub

Private Sub cmdupdate_Click() frmupdate.Show End Sub

Private Sub cmdviewdelete_Click() frmviewdelete.Show End Sub
Form Name: frmadd

Code:

Option Explicit
Dim rs As New ADODB.Recordset
Dim db As New ADODB.Connection

Private Sub cmdadd_Click()
If Me.txtlastname.Text = "" Then
MsgBox "please input your last name"
Me.txtlastname.SetFocus
Exit Sub
ElseIf Me.txtfirstname.Text = "" Then
MsgBox "please input your first name"
Me.txtfirstname.SetFocus
Exit Sub
ElseIf Me.txtmiddlename.Text = "" Then
MsgBox "please input your middle name"
Me.txtmiddlename.SetFocus
Exit Sub
ElseIf Me.txtstreet.Text = "" Then
MsgBox "please input the street"
Me.txtstreet.SetFocus
Exit Sub
ElseIf Me.txtbarangay.Text = "" Then
MsgBox "please input barangay"
Me.txtbarangay.SetFocus
Exit Sub
ElseIf Me.txtmunicipality.Text = "" Then
MsgBox "please input municipality"
Me.txtmunicipality.SetFocus
Exit Sub
ElseIf Me.txtprovince.Text = "" Then
MsgBox "please input province"
Me.txtprovince.SetFocus
Exit Sub
ElseIf Me.txtcontactno.Text = "" Then
MsgBox "please input your contact number"
Me.txtcontactno.SetFocus
Exit Sub
ElseIf Me.cbobmonth.Text = "" Then
MsgBox "please input the month of your bday"
Me.cbobmonth.SetFocus
Exit Sub
ElseIf Me.cbobday.Text = "" Then
MsgBox "please input the day of your bday"
Me.cbobday.SetFocus
Exit Sub
ElseIf Me.cbobyear.Text = "" Then
MsgBox "please input the year of your bday"
Me.cbobyear.SetFocus
Exit Sub
ElseIf Me.cbocourse.Text = "" Then
MsgBox "please input your course"
Me.cbocourse.SetFocus
Exit Sub
ElseIf Me.cboyear.Text = "" Then
MsgBox "please input your year"

You May Also Find These Documents Helpful

  • Better Essays

    2. Create a Windows application that contains a button labeled OK and a textbox labeled Name. Change the…

    • 1713 Words
    • 7 Pages
    Better Essays
  • Satisfactory Essays

    Form a deliberative body to explore the concept of shifting the focus of VBA’s mission towards the rehabilitation of disabled Veterans and their social and economic reintegration into the society of which they are a part as opposed to focusing on the delivery of compensation benefits for service related disabilities. A key deliverable of this body would include developing a written plan that would include the required strategies, objectives, measures of performance and effectiveness, as well as an internal and external communication and promotional plan. This plan would supplement VBA’s Long Range Plan and would closely mirror VBA’s previous transformation plan.…

    • 203 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    Javascript Error Handling

    • 255 Words
    • 2 Pages

    1. Write JavaScript code that anticipates and handles an error for an expected numeric field. This code is executed on keypress and the entered value is saved for you in a variable called enteredChar. Include the try block of JavaScript statements needed to check if the character is not a number or a non-alphanumeric character or if you throw an error message.…

    • 255 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    As you recall, data is a collection of facts (numbers, text, even audio and video files) that is processed into usable information. Much like a spreadsheet, a database is a collection of such facts that you can then slice and dice in various ways to extract information or make decisions. However, the advantage and primary use of a database over a spreadsheet is its ability to handle a large volume of data and yet allow for quick access to the information that is desired.…

    • 1190 Words
    • 5 Pages
    Powerful Essays
  • Powerful Essays

    Type your name, the date, your teacher’s name, and your school name at the top of this page. Type or paste your draft into this document. Be sure that your draft is double-spaced and in 12 point, Times New Roman font. Save the file as BWL_S1_06.05_Critical Skills Practice_FirstInitial_LastName.doc.…

    • 800 Words
    • 4 Pages
    Powerful Essays
  • Satisfactory Essays

    PT1420 Assign1 UNit6

    • 540 Words
    • 2 Pages

    7. Design an If- Then- Else statement ( or a flowchart with a dual alternative deci-sion structure) that displays “ Speed is normal” if the speed variable is within the range of 24 to 56. If speed holds a value outside this range, display “ Speed is abnormal.”…

    • 540 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Type your name, the date, your teacher’s name, and your school name at the top of this page. Type or paste your draft into this document. Be sure that your draft is double-spaced, 12 point Times new Roman font. Save the file as AML_S1_09.04_Critical Skills Practice_FirstInitial_LastName.doc.…

    • 457 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    visual basic

    • 8352 Words
    • 34 Pages

    Function SubMatchTest(inpStr) Dim oRe, oMatch, oMatches Set oRe = New RegExp ' Look for an email address (not a perfect RegExp). oRe. Pattern = "(\w+)@(\w+)\.(\w+)" ' Get the Matches collection.…

    • 8352 Words
    • 34 Pages
    Satisfactory Essays
  • Satisfactory Essays

    * Create a Programmer Header that includes the name of your VBScript file, your name, the date, the class, and the name of your professor. Each of these VBScript comment lines begin with a (‘) character.…

    • 1575 Words
    • 7 Pages
    Satisfactory Essays
  • Good Essays

    Sas If Then Else

    • 1347 Words
    • 6 Pages

    Using IF THEN ELSE statements, LENGTH is to be use so that the new coloum create (Patient) will have defined length that is $12.…

    • 1347 Words
    • 6 Pages
    Good Essays
  • Good Essays

    Responding To A Prompt 2

    • 397 Words
    • 2 Pages

    Type your name, the date, your teacher’s name, and your school name at the top of this page. Type or paste your draft into this document. Be sure that your draft is double-spaced and in 12 point, Times New Roman font. Save the file as BWL_S2_02.06_Critical Skills Practice_FirstInitial_LastName.doc.…

    • 397 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    ExcelSolverTutorial

    • 1416 Words
    • 12 Pages

    In order to enter your data and work with it in the most straightforward way it is…

    • 1416 Words
    • 12 Pages
    Powerful Essays
  • Satisfactory Essays

    I went to the Microsoft article 982760 (supplied by Tony Mac. on July 29, 2011 and Debbie MFST on July 28 2011) and - after skim reading it - wondered if I could instead use my disk for MS Office 2003…

    • 286 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    A database application is a computer program whose primary purpose is entering and retrieving information from a computer-managed database. Early examples of database applications were accounting systems and airline reservations systems, such as SABRE, developed starting in 1957.…

    • 513 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    Asp.Net

    • 4672 Words
    • 19 Pages

    GURU NANAK DEV ENGINEERING COLLEGE, LUDHIANA DEPTT. OF CSE/IT LECTURE NOTES Subject: Web Administration Topic: Active Server Pages (ASP) Subject Incharge: Er. Parminder Kaur Wadhwa, Lecturer (CSE/IT) ___________________________________________________________________________________…

    • 4672 Words
    • 19 Pages
    Powerful Essays