⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmaddresssearch.vb

📁 Online Telephone Directory in Visual Basic
💻 VB
字号:
Option Strict Off
Option Explicit On
Friend Class Form7
	Inherits System.Windows.Forms.Form
	'UPGRADE_WARNING: Arrays in structure rs may need to be initialized before they can be used. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="814DF224-76BD-4BB4-BFFB-EA359CB9FC48"'
	Dim db As DAO.Database
	Dim rs As DAO.Recordset
	Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
		Label11.Text = ""
		Label12.Text = ""
		If Option2.Checked = True And Text1.Text <> "" Then
			rs = db.OpenRecordset("Select * from Subscriber where Phone = '" & Text1.Text & "'")
			If rs.RecordCount <> 0 Then
				Frame2.Visible = True
				Label11.Text = rs.Fields(0).Value & ", " & rs.Fields(1).Value
				Label12.Text = rs.Fields(2).Value
			Else
				Frame2.Visible = False
				MsgBox("Please type the correct Phone Number ", MsgBoxStyle.Information)
			End If
		ElseIf Option1.Checked = True And Text1.Text <> "" Then 
			rs = db.OpenRecordset("Select * from Subscriber where Name Like '" & StrConv(Trim(Text1.Text), VbStrConv.ProperCase) & "*'")
			
			If rs.RecordCount <> 0 Then
				rs.MoveLast()
				Frame2.Visible = True
				rs.MoveFirst()
				While rs.EOF <> True
					Label11.Text = Label11.Text & rs.Fields(0).Value & ", " & rs.Fields(1).Value & vbCrLf
					Label12.Text = Label12.Text & rs.Fields(2).Value & vbCrLf
					Label11.Text = StrConv(Label11.Text, VbStrConv.ProperCase)
					rs.MoveNext()
				End While
			Else
				Frame2.Visible = False
				MsgBox("Please type the correct Name", MsgBoxStyle.Information)
			End If
		Else
			MsgBox("Enter Country Name or ISD Code", MsgBoxStyle.Information)
		End If
		
	End Sub
	
	Private Sub Command2_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command2.Click
		Option1.Checked = True
		Text1.Text = ""
		Frame2.Visible = False
	End Sub
	
	Private Sub Command3_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command3.Click
		Me.Close()
		Form1.Show()
	End Sub
	
	Private Sub Form7_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		db = DAODBEngine_definst.OpenDatabase(My.Application.Info.DirectoryPath & "\Database\DirDB.mdb")
		
	End Sub
	
	Private Sub Label3_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Label3.Click
		Me.Close()
		Form12.Show()
	End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -