home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161b.iso / handson / archive / Issue159 / files / copyvbwk.exe / reports.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-10-02  |  2.5 KB  |  86 lines

  1. VERSION 5.00
  2. Begin VB.Form Reports 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   4410
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   7005
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   4410
  10.    ScaleWidth      =   7005
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton Command2 
  13.       Caption         =   "SQL"
  14.       Height          =   495
  15.       Left            =   3960
  16.       TabIndex        =   3
  17.       Top             =   3240
  18.       Width           =   1455
  19.    End
  20.    Begin VB.CommandButton Command1 
  21.       Caption         =   "Loop"
  22.       Height          =   495
  23.       Left            =   840
  24.       TabIndex        =   2
  25.       Top             =   3240
  26.       Width           =   1335
  27.    End
  28.    Begin VB.ListBox List2 
  29.       BeginProperty Font 
  30.          Name            =   "MS Sans Serif"
  31.          Size            =   12
  32.          Charset         =   0
  33.          Weight          =   400
  34.          Underline       =   0   'False
  35.          Italic          =   0   'False
  36.          Strikethrough   =   0   'False
  37.       EndProperty
  38.       Height          =   2160
  39.       Left            =   3480
  40.       TabIndex        =   1
  41.       Top             =   720
  42.       Width           =   2655
  43.    End
  44.    Begin VB.ListBox List1 
  45.       BeginProperty Font 
  46.          Name            =   "MS Sans Serif"
  47.          Size            =   12
  48.          Charset         =   0
  49.          Weight          =   400
  50.          Underline       =   0   'False
  51.          Italic          =   0   'False
  52.          Strikethrough   =   0   'False
  53.       EndProperty
  54.       Height          =   2160
  55.       Left            =   480
  56.       TabIndex        =   0
  57.       Top             =   720
  58.       Width           =   2655
  59.    End
  60. Attribute VB_Name = "Reports"
  61. Attribute VB_GlobalNameSpace = False
  62. Attribute VB_Creatable = False
  63. Attribute VB_PredeclaredId = True
  64. Attribute VB_Exposed = False
  65. Private Sub Command1_Click()
  66. Dim rs As Recordset
  67. Set rs = MainForm.Data2.Recordset
  68. With rs
  69.     While Not .EOF
  70.         List1.AddItem (.Fields!Name & ":" & .Fields!DateSent & ":" & .Fields!issueNumber)
  71.         .MoveNext
  72.     Wend
  73. End With
  74. End Sub
  75. Private Sub Command2_Click()
  76. Dim q As QueryDef, rs As Recordset
  77. Set q = MainForm.Data1.Database.CreateQueryDef("", "SELECT * FROM MailingDate ORDER BY Name DESC")
  78. Set rs = q.OpenRecordset
  79. With rs
  80.     While Not .EOF
  81.         List2.AddItem (.Fields!Name & ":" & .Fields!DateSent & ":" & .Fields!issueNumber)
  82.         .MoveNext
  83.     Wend
  84. End With
  85. End Sub
  86.