home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 4_2005-2006.ISO / data / Zips / customer_c189748652005.psc / compqueryfrm.frm < prev    next >
Text File  |  1995-03-04  |  7KB  |  220 lines

  1. VERSION 5.00
  2. Begin VB.Form compqueryfrm 
  3.    BackColor       =   &H00FFFFFF&
  4.    Caption         =   "Complaints Query Form"
  5.    ClientHeight    =   3180
  6.    ClientLeft      =   60
  7.    ClientTop       =   360
  8.    ClientWidth     =   5805
  9.    BeginProperty Font 
  10.       Name            =   "Verdana"
  11.       Size            =   8.25
  12.       Charset         =   0
  13.       Weight          =   400
  14.       Underline       =   0   'False
  15.       Italic          =   0   'False
  16.       Strikethrough   =   0   'False
  17.    EndProperty
  18.    LinkTopic       =   "Form1"
  19.    MDIChild        =   -1  'True
  20.    ScaleHeight     =   3180
  21.    ScaleWidth      =   5805
  22.    Begin VB.Frame Fieldframe 
  23.       BackColor       =   &H00FFFFFF&
  24.       BeginProperty Font 
  25.          Name            =   "MS Sans Serif"
  26.          Size            =   8.25
  27.          Charset         =   0
  28.          Weight          =   400
  29.          Underline       =   0   'False
  30.          Italic          =   0   'False
  31.          Strikethrough   =   0   'False
  32.       EndProperty
  33.       Height          =   2085
  34.       Left            =   570
  35.       TabIndex        =   3
  36.       Top             =   330
  37.       Width           =   6405
  38.       Begin VB.ComboBox value 
  39.          Appearance      =   0  'Flat
  40.          BackColor       =   &H00FFFFFF&
  41.          Height          =   315
  42.          Left            =   1740
  43.          TabIndex        =   1
  44.          Top             =   900
  45.          Width           =   4395
  46.       End
  47.       Begin VB.CommandButton cmdsearch 
  48.          Caption         =   "&Goto This Record"
  49.          Height          =   375
  50.          Left            =   1470
  51.          Picture         =   "compqueryfrm.frx":0000
  52.          TabIndex        =   2
  53.          Top             =   1470
  54.          Width           =   1665
  55.       End
  56.       Begin VB.ComboBox field 
  57.          Appearance      =   0  'Flat
  58.          BackColor       =   &H00FFFFFF&
  59.          Height          =   315
  60.          ItemData        =   "compqueryfrm.frx":0442
  61.          Left            =   1740
  62.          List            =   "compqueryfrm.frx":0458
  63.          TabIndex        =   0
  64.          Top             =   360
  65.          Width           =   1815
  66.       End
  67.       Begin VB.Label lblvalues 
  68.          BackColor       =   &H00FFFFFF&
  69.          Caption         =   "Value:"
  70.          BeginProperty Font 
  71.             Name            =   "Verdana"
  72.             Size            =   9.75
  73.             Charset         =   0
  74.             Weight          =   700
  75.             Underline       =   0   'False
  76.             Italic          =   0   'False
  77.             Strikethrough   =   0   'False
  78.          EndProperty
  79.          Height          =   315
  80.          Left            =   450
  81.          TabIndex        =   5
  82.          Top             =   870
  83.          Width           =   825
  84.       End
  85.       Begin VB.Label lblfield 
  86.          BackColor       =   &H00FFFFFF&
  87.          Caption         =   "Search By:"
  88.          BeginProperty Font 
  89.             Name            =   "Verdana"
  90.             Size            =   9.75
  91.             Charset         =   0
  92.             Weight          =   700
  93.             Underline       =   0   'False
  94.             Italic          =   0   'False
  95.             Strikethrough   =   0   'False
  96.          EndProperty
  97.          Height          =   255
  98.          Left            =   450
  99.          TabIndex        =   4
  100.          Top             =   360
  101.          Width           =   1335
  102.       End
  103.    End
  104. End
  105. Attribute VB_Name = "compqueryfrm"
  106. Attribute VB_GlobalNameSpace = False
  107. Attribute VB_Creatable = False
  108. Attribute VB_PredeclaredId = True
  109. Attribute VB_Exposed = False
  110. Private Sub cmdsearch_Click()
  111. If prodinstfrm.custrs.RecordCount > 0 Then
  112.     prodinstfrm.setcustcom
  113.         If field.Text = "Phone1" Then
  114.             prodinstfrm.custrs.Filter = "cust_ph1='" & value.Text & "'"
  115.         End If
  116.         If field.Text = "Phone2" Then
  117.             prodinstfrm.custrs.Filter = "cust_ph2=" & value.Text
  118.         End If
  119.         If field.Text = "Address" Then
  120.             prodinstfrm.custrs.Filter = "cust_add='" & value.Text & "'"
  121.         End If
  122.         If field.Text = "Email" Then
  123.             prodinstfrm.custrs.Filter = "cust_email='" & value.Text & "'"
  124.         End If
  125.         If field.Text = "Fax" Then
  126.             prodinstfrm.custrs.Filter = "cust_fax=" & value.Text
  127.         End If
  128.         If field.Text = "Complaint No" Then
  129.             prodinstfrm.setcompcom
  130.             prodinstfrm.comprs.Filter = "comp_no=" & value.Text
  131.             If prodinstfrm.comprs.EOF = False And prodinstfrm.comprs.BOF = False Then
  132.                 curcustph1 = prodinstfrm.comprs.Fields(0)
  133.                 curcustdate = prodinstfrm.comprs.Fields(1)
  134.                 Unload compqueryfrm
  135.                 newcomplaint = 2
  136.                 Exit Sub
  137.             Else
  138.                 MsgBox ("Record Not Found")
  139.                 value.SetFocus
  140.             End If
  141.         End If
  142.         
  143.         If prodinstfrm.custrs.BOF = False And prodinstfrm.custrs.EOF = False Then
  144.             curcustph1 = prodinstfrm.custrs.Fields(5)
  145.             Unload compqueryfrm
  146.             Else
  147.             MsgBox ("Record Not Found")
  148.             value.SetFocus
  149.         End If
  150.         newcomplaint = 1
  151. End If
  152. End Sub
  153. Private Sub field_Click()
  154. fillvalues
  155. End Sub
  156. Private Sub field_KeyPress(KeyAscii As Integer)
  157. If KeyAscii = 13 Then
  158.   SendKeys "{TAB}", True
  159. End If
  160. KeyAscii = 0
  161. End Sub
  162. Private Sub field_KeyUp(KeyCode As Integer, Shift As Integer)
  163. fillvalues
  164. End Sub
  165. Private Sub Form_Activate()
  166. prodinstfrm.setcustcom
  167. prodinstfrm.setcompcom
  168. field.Text = field.List(0)
  169. If prodinstfrm.custrs.RecordCount > 0 Then
  170.     prodinstfrm.custrs.MoveFirst
  171.     Do While Not prodinstfrm.custrs.EOF
  172.         value.AddItem (prodinstfrm.custrs.Fields(5))
  173.         prodinstfrm.custrs.MoveNext
  174.     Loop
  175. End If
  176. value.Text = value.List(0)
  177. End Sub
  178. Private Sub value_KeyPress(KeyAscii As Integer)
  179. If KeyAscii = 13 Then
  180.   SendKeys "{TAB}", True
  181. End If
  182. End Sub
  183. Public Sub fillvalues()
  184. If prodinstfrm.custrs.RecordCount = 0 Then
  185.     Exit Sub
  186.     Else
  187.     value.Clear
  188. End If
  189.  
  190. prodinstfrm.custrs.MoveFirst
  191. Do While Not prodinstfrm.custrs.EOF
  192.     If field.Text = "Phone1" Then
  193.         value.AddItem prodinstfrm.custrs.Fields(5)
  194.     End If
  195.     If field.Text = "Phone2" Then
  196.         value.AddItem prodinstfrm.custrs.Fields(6)
  197.     End If
  198.     If field.Text = "Address" Then
  199.         value.AddItem prodinstfrm.custrs.Fields(1)
  200.     End If
  201.     If field.Text = "Email" Then
  202.         value.AddItem prodinstfrm.custrs.Fields(8)
  203.     End If
  204.     If field.Text = "Fax" Then
  205.         value.AddItem prodinstfrm.custrs.Fields(7)
  206.     End If
  207.     prodinstfrm.custrs.MoveNext
  208. Loop
  209. If field.Text = "Complaint No" Then
  210.     If prodinstfrm.comprs.RecordCount > 0 Then
  211.         prodinstfrm.comprs.MoveFirst
  212.         Do While Not prodinstfrm.comprs.EOF
  213.             value.AddItem prodinstfrm.comprs.Fields(8)
  214.             prodinstfrm.comprs.MoveNext
  215.         Loop
  216.     End If
  217. End If
  218. value.Text = value.List(0)
  219. End Sub
  220.