Application developed with Access 2002, Part 1.


 

Initial Step,  Beginning....

  • Create the folder A2002 in the C: drive, (C:\A2002).
  • Create the folder res in the folder A2002, C:\A2002\res.
  • From the Access 2002 folder, copy the file - KJV2002.mdb to the folder C:\A2002 and remove the read-only attribute of the file C:\A2002\KJV2002.mdb - (KJV2002.mdb - database Access 2002 file format).
  • Run Microsoft Access 2002.
  • From the File menu, click Open, the Open dialog box appears, select the file KJV2002.mdb of  the folder C:\A2002 and  click Open.
  • 1st Step,  MainForm Form..

    Operations:

    1. Create MainForm
      From the KJV2002:Database dialog box displays, Choose and Click The Tab - Forms and then click New.
      From the new dialog box - New Form displays, Select Design Form and then click Open
      The Form Design displays, From the File menu click Save, the new dialog box - Save as displays, Type MainForm (name form) and then click Ok
      Add controls to the MainForm form
    2. Modify MainForm
      From the KJV2002:Database dialog box displays, Choose and Click The Tab - Forms, Select Mainform and then click Design.
      Use the Toolbox to add new control
      From the View menu click Code, to Add the Code


     MainForm design:.

    ......
    .
    .

    ...
    Welcome to KJV2002
    Learn how to write a Microsoft Access 2002 application ...

    .


            

    1.  MainForm Object and controls :
      1. The MainForm, Form Properties:
        default View:
        Auto Center:
        Min Max Buttons:
        Navigation Buttons:
        Pop Up:
        Modal:
        On Open:
        Single Form
        Yes
        None
        No
        Yes
        Yes
        (Event Procedure)


      2. Add the file :
        From the ...\A2002 Html\Pic folder (downloaded ...) copy the (GIF Image) ingraphic1.gif  file  to the folder C:\A2002\ res.

         

      3. Add the following controls, from the Toolbox :
        One Rectangle, one Image, two Labels and two Command Buttons
        1. Add the Rectangle -Box1 Properties:
          Use for graphic effects such as grouping a set of related controls on a form, or emphasizing important data on a report.
          Name:
          Visible
          Box1
          Yes


        2. Add the Image - Image1 Properties:
          Use the Image control to display a graphic. An Image control can display a graphic from a bitmap, icon, or metafile, as well as enhanced metafile, JPEG, or GIF files.
          Name:
          Picture:
          Visible:
          Image1
          (none)
          Yes


          No
          te:
          The image1
          displays the file ingraphic1.gif , stored in the folder C:\A 2002\res
           

        3. Add the Label - Label1 Properties:
          A Label control is a graphical control you can use to display text that a user can't change directly.
          Name:
          Caption:
          Font:
          Label1
          Welcome to KJV, ...
          Times New Roman, Bold, size = 9


        4. Add the Label - Label10 Properties:
          A Label control is a graphical control you can use to display text that a user can't change directly.
          Name:
          Caption:
          Font:
          Label10
          One moment ...
          Times New Roman, Bold, size = 9


        5. Add the Command Button -CmdContinue Properties:
          Use a CommandButton control to begin, interrupt, or end a process. When chosen, a CommandButton appears pushed in and so is sometimes called a push button.
          Name:
          Caption:
          On Click
          CmdContinue
          Continue
          (Event Procedure)


        6. Add the Command Button -CmdExit Properties:
          Use a CommandButton control to begin, interrupt, or end a process. When chosen, a CommandButton appears pushed in and so is sometimes called a push button.
          Name:
          Caption:
          On Click
          CmdExit
          Exit
          (Event Procedure)
    2. From Tools menu, click Startup, Startup dialog box appears

      Note:
      Set Startup - Show the application KJV2002 automatically when you click the Access file KJV2002.mdb   
       

      Type in Application Title box = KJV2002
      Type in DisplayForm/Page box  = MainForm
       

    3. MainForm Codes ...

       
      the new text Code to be add is red.
      Option Compare Database


      Private Sub Form_Load()
      Image1.Picture = Application.CurrentProject.Path & "\res\ingraphic1.gif"
      End Sub
      Private Sub CmdContinue_Click()
      On Error GoTo Err_CmdContinue_Click

      ' Label10 = One moment...
      Me.Label10.Visible = True

      ' Open Book form.
      DoCmd.OpenForm ("Book")

      If (CurrentProject.IsConnected) Then
      ' Closes mainform form.
      DoCmd.Close acForm, "mainForm", acSaveNo
      End If
      '*********************************
      Exit_CmdContinue_Click:
      Exit Sub

      Err_CmdContinue_Click:
      MsgBox Err.Description
      Resume Exit_CmdContinue_Click

      End Sub
      '*********************************
      Private Sub CmdExit_Click()
      On Error GoTo Err_CmdExit_Click


      DoCmd.Close

      Exit_CmdExit_Click:
      Exit Sub

      Err_CmdExit_Click:
      MsgBox Err.Description
      Resume Exit_CmdExit_Click

      End Sub
    4.  The mdules,  Start Main Codes ...
      A module is essentially a collection of declarations, statements, and procedures stored together as one named unit to organize your Microsoft Visual Basic code. Microsoft Access has two types of modules: standard modules and class modules.

       the new text Code to be add is red.

      Option Compare Database

      Option Explicit

      Public ChapterStr As String
      Public VerseStr As String
      '
      SQL
      Public Const SQLStr = "select Book,BookTitle,Chapter,Verse,TextData from BibleTable WHERE (BibleTable.Chapter <> '000') ORDER BY BibleTable.Book, BibleTable.Chapter, BibleTable.Verse"

       

     


    Previous
      Home
    1
     
    Next