home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / address / search.frm < prev    next >
Text File  |  1993-07-05  |  11KB  |  361 lines

  1. VERSION 2.00
  2. Begin Form Search 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Mike's Address Search"
  6.    ClientHeight    =   2265
  7.    ClientLeft      =   2310
  8.    ClientTop       =   3030
  9.    ClientWidth     =   4035
  10.    Height          =   2955
  11.    Left            =   2250
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   2265
  16.    ScaleWidth      =   4035
  17.    Top             =   2400
  18.    Width           =   4155
  19.    Begin SSCommand Command3D2 
  20.       BevelWidth      =   3
  21.       Caption         =   "&Cancel"
  22.       Font3D          =   3  'Inset w/light shading
  23.       FontBold        =   -1  'True
  24.       FontItalic      =   0   'False
  25.       FontName        =   "Arial"
  26.       FontSize        =   8.25
  27.       FontStrikethru  =   0   'False
  28.       FontUnderline   =   0   'False
  29.       Height          =   375
  30.       Left            =   3000
  31.       TabIndex        =   13
  32.       Top             =   1320
  33.       Width           =   855
  34.    End
  35.    Begin SSCommand Command3D1 
  36.       BevelWidth      =   3
  37.       Caption         =   "&Ok"
  38.       Font3D          =   3  'Inset w/light shading
  39.       FontBold        =   -1  'True
  40.       FontItalic      =   0   'False
  41.       FontName        =   "Arial"
  42.       FontSize        =   8.25
  43.       FontStrikethru  =   0   'False
  44.       FontUnderline   =   0   'False
  45.       Height          =   375
  46.       Left            =   3000
  47.       TabIndex        =   12
  48.       Top             =   840
  49.       Width           =   855
  50.    End
  51.    Begin SSFrame Frame3D1 
  52.       Caption         =   "Search :"
  53.       Font3D          =   3  'Inset w/light shading
  54.       FontBold        =   -1  'True
  55.       FontItalic      =   0   'False
  56.       FontName        =   "Arial"
  57.       FontSize        =   8.25
  58.       FontStrikethru  =   0   'False
  59.       FontUnderline   =   0   'False
  60.       Height          =   1455
  61.       Left            =   120
  62.       ShadowColor     =   1  'Black
  63.       ShadowStyle     =   1  'Raised
  64.       TabIndex        =   2
  65.       Top             =   720
  66.       Width           =   2655
  67.       Begin SSCheck Check3D9 
  68.          Caption         =   "Phone"
  69.          Font3D          =   3  'Inset w/light shading
  70.          FontBold        =   -1  'True
  71.          FontItalic      =   0   'False
  72.          FontName        =   "Arial"
  73.          FontSize        =   8.25
  74.          FontStrikethru  =   0   'False
  75.          FontUnderline   =   0   'False
  76.          Height          =   195
  77.          Left            =   1320
  78.          TabIndex        =   11
  79.          Top             =   960
  80.          Value           =   -1  'True
  81.          Width           =   1215
  82.       End
  83.       Begin SSCheck Check3D8 
  84.          Caption         =   "Information"
  85.          Font3D          =   3  'Inset w/light shading
  86.          FontBold        =   -1  'True
  87.          FontItalic      =   0   'False
  88.          FontName        =   "Arial"
  89.          FontSize        =   8.25
  90.          FontStrikethru  =   0   'False
  91.          FontUnderline   =   0   'False
  92.          Height          =   195
  93.          Left            =   1320
  94.          TabIndex        =   10
  95.          Top             =   720
  96.          Value           =   -1  'True
  97.          Width           =   1215
  98.       End
  99.       Begin SSCheck Check3D7 
  100.          Caption         =   "Message"
  101.          Font3D          =   3  'Inset w/light shading
  102.          FontBold        =   -1  'True
  103.          FontItalic      =   0   'False
  104.          FontName        =   "Arial"
  105.          FontSize        =   8.25
  106.          FontStrikethru  =   0   'False
  107.          FontUnderline   =   0   'False
  108.          Height          =   195
  109.          Left            =   1320
  110.          TabIndex        =   9
  111.          Top             =   480
  112.          Value           =   -1  'True
  113.          Width           =   1215
  114.       End
  115.       Begin SSCheck Check3D6 
  116.          Caption         =   "Country"
  117.          Font3D          =   3  'Inset w/light shading
  118.          FontBold        =   -1  'True
  119.          FontItalic      =   0   'False
  120.          FontName        =   "Arial"
  121.          FontSize        =   8.25
  122.          FontStrikethru  =   0   'False
  123.          FontUnderline   =   0   'False
  124.          Height          =   195
  125.          Left            =   1320
  126.          TabIndex        =   8
  127.          Top             =   240
  128.          Value           =   -1  'True
  129.          Width           =   1215
  130.       End
  131.       Begin SSCheck Check3D5 
  132.          Caption         =   "Zip Code"
  133.          Font3D          =   3  'Inset w/light shading
  134.          FontBold        =   -1  'True
  135.          FontItalic      =   0   'False
  136.          FontName        =   "Arial"
  137.          FontSize        =   8.25
  138.          FontStrikethru  =   0   'False
  139.          FontUnderline   =   0   'False
  140.          Height          =   195
  141.          Left            =   120
  142.          TabIndex        =   7
  143.          Top             =   1200
  144.          Value           =   -1  'True
  145.          Width           =   1095
  146.       End
  147.       Begin SSCheck Check3D4 
  148.          Caption         =   "State"
  149.          Font3D          =   3  'Inset w/light shading
  150.          FontBold        =   -1  'True
  151.          FontItalic      =   0   'False
  152.          FontName        =   "Arial"
  153.          FontSize        =   8.25
  154.          FontStrikethru  =   0   'False
  155.          FontUnderline   =   0   'False
  156.          Height          =   195
  157.          Left            =   120
  158.          TabIndex        =   6
  159.          Top             =   960
  160.          Value           =   -1  'True
  161.          Width           =   1095
  162.       End
  163.       Begin SSCheck Check3D3 
  164.          Caption         =   "City"
  165.          Font3D          =   3  'Inset w/light shading
  166.          FontBold        =   -1  'True
  167.          FontItalic      =   0   'False
  168.          FontName        =   "Arial"
  169.          FontSize        =   8.25
  170.          FontStrikethru  =   0   'False
  171.          FontUnderline   =   0   'False
  172.          Height          =   195
  173.          Left            =   120
  174.          TabIndex        =   5
  175.          Top             =   720
  176.          Value           =   -1  'True
  177.          Width           =   1095
  178.       End
  179.       Begin SSCheck Check3D2 
  180.          Caption         =   "Street"
  181.          Font3D          =   3  'Inset w/light shading
  182.          FontBold        =   -1  'True
  183.          FontItalic      =   0   'False
  184.          FontName        =   "Arial"
  185.          FontSize        =   8.25
  186.          FontStrikethru  =   0   'False
  187.          FontUnderline   =   0   'False
  188.          Height          =   195
  189.          Left            =   120
  190.          TabIndex        =   4
  191.          Top             =   480
  192.          Value           =   -1  'True
  193.          Width           =   1095
  194.       End
  195.       Begin SSCheck Check3D1 
  196.          Caption         =   "Name"
  197.          Font3D          =   3  'Inset w/light shading
  198.          FontBold        =   -1  'True
  199.          FontItalic      =   0   'False
  200.          FontName        =   "Arial"
  201.          FontSize        =   8.25
  202.          FontStrikethru  =   0   'False
  203.          FontUnderline   =   0   'False
  204.          Height          =   195
  205.          Left            =   120
  206.          TabIndex        =   3
  207.          Top             =   240
  208.          Value           =   -1  'True
  209.          Width           =   1095
  210.       End
  211.    End
  212.    Begin TextBox Text1 
  213.       FontBold        =   -1  'True
  214.       FontItalic      =   0   'False
  215.       FontName        =   "Arial"
  216.       FontSize        =   8.25
  217.       FontStrikethru  =   0   'False
  218.       FontUnderline   =   0   'False
  219.       Height          =   315
  220.       Left            =   120
  221.       MaxLength       =   35
  222.       TabIndex        =   1
  223.       Top             =   360
  224.       Width           =   3855
  225.    End
  226.    Begin Label Label1 
  227.       AutoSize        =   -1  'True
  228.       BackStyle       =   0  'Transparent
  229.       Caption         =   "Enter Search String Below:"
  230.       FontBold        =   -1  'True
  231.       FontItalic      =   0   'False
  232.       FontName        =   "Arial"
  233.       FontSize        =   8.25
  234.       FontStrikethru  =   0   'False
  235.       FontUnderline   =   0   'False
  236.       Height          =   210
  237.       Left            =   120
  238.       TabIndex        =   0
  239.       Top             =   120
  240.       Width           =   2190
  241.    End
  242.    Begin Menu MenuPaste 
  243.       Caption         =   "&Paste"
  244.    End
  245. End
  246.  
  247. Sub Command3D1_Click ()
  248. 'make sure one at least one check box checked
  249. OneChecked% = False
  250. If Check3D1.Value Or Check3D2.Value Or Check3D3.Value Or Check3D4.Value Then
  251.     OneChecked% = True
  252. ElseIf Check3D5.Value Or Check3D6.Value Or Check3D7.Value Or Check3D8.Value Or Check3D9.Value Then
  253.     OneChecked% = True
  254. End If
  255. 'make sure we have a text search string
  256. If Trim$(Text1.Text) <> "" And OneChecked% = True Then
  257.     Search.Tag = "YES"
  258. Else
  259.     Search.Tag = "NO"
  260. End If
  261. Search.Hide
  262. End Sub
  263.  
  264. Sub Command3D2_Click ()
  265. 'setting form tag is easy way to pass info back and forth
  266. 'between forms
  267. Search.Tag = ""
  268. Search.Hide
  269. End Sub
  270.  
  271. Sub Form_Load ()
  272. INIFile$ = ThePath & "Address.ini"
  273. Default$ = "NOCHECK"
  274. TC$ = GetPPKeyString$("Checked", "HasCheck", Default$, INIFile$)
  275. If TC$ <> "NOCHECK" Then
  276.     If InStr(TC$, "1") = 0 Then
  277.         Check3D1.Value = False
  278.     End If
  279.     If InStr(TC$, "2") = 0 Then
  280.         Check3D2.Value = False
  281.     End If
  282.     If InStr(TC$, "3") = 0 Then
  283.         Check3D3.Value = False
  284.     End If
  285.     If InStr(TC$, "4") = 0 Then
  286.         Check3D4.Value = False
  287.     End If
  288.     If InStr(TC$, "5") = 0 Then
  289.         Check3D5.Value = False
  290.     End If
  291.     If InStr(TC$, "6") = 0 Then
  292.         Check3D6.Value = False
  293.     End If
  294.     If InStr(TC$, "7") = 0 Then
  295.         Check3D7.Value = False
  296.     End If
  297.     If InStr(TC$, "8") = 0 Then
  298.         Check3D8.Value = False
  299.     End If
  300.     If InStr(TC$, "9") = 0 Then
  301.         Check3D9.Value = False
  302.     End If
  303. End If
  304. If Clipboard.GetFormat(1) Then
  305.     MenuPaste.Enabled = True
  306. Else
  307.     MenuPaste.Enabled = False
  308. End If
  309. Search.Top = Address.Top + ((Address.Height - Search.Height) \ 3)
  310. Search.Left = Address.Left + ((Address.Width - Search.Width) \ 2)
  311. End Sub
  312.  
  313. Sub Form_Unload (Cancel As Integer)
  314. TC$ = ""
  315. If Check3D1.Value Then
  316.     TC$ = TC$ & "1"
  317. End If
  318. If Check3D2.Value Then
  319.     TC$ = TC$ & "2"
  320. End If
  321. If Check3D3.Value Then
  322.     TC$ = TC$ & "3"
  323. End If
  324. If Check3D4.Value Then
  325.     TC$ = TC$ & "4"
  326. End If
  327. If Check3D5.Value Then
  328.     TC$ = TC$ & "5"
  329. End If
  330. If Check3D6.Value Then
  331.     TC$ = TC$ & "6"
  332. End If
  333. If Check3D7.Value Then
  334.     TC$ = TC$ & "7"
  335. End If
  336. If Check3D8.Value Then
  337.     TC$ = TC$ & "8"
  338. End If
  339. If Check3D9.Value Then
  340.     TC$ = TC$ & "9"
  341. End If
  342. INIFile$ = ThePath & "address.ini"
  343. x% = WritePPKeyString%("Checked", "HasCheck", TC$, INIFile$)
  344. End Sub
  345.  
  346. Sub MenuPaste_Click ()
  347. 'allows user to copy info from address and just paste
  348. If TypeOf Screen.ActiveControl Is TextBox Then
  349.     Screen.ActiveControl.SelText = Clipboard.GetText()
  350. End If
  351. End Sub
  352.  
  353. Sub Text1_KeyPress (KeyAscii As Integer)
  354. 'don't allow these characters. they mess up sqlq search
  355. If KeyAscii = 91 Or KeyAscii = 93 Then
  356.     Beep            'stop [ and ] special to like
  357.     KeyAscii = 0
  358. End If
  359. End Sub
  360.  
  361.