📄 frmisdsearch.vb
字号:
Option Strict Off
Option Explicit On
Friend Class Form6
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
If Option1.Checked = True And Text1.Text <> "" Then
rs = db.OpenRecordset("Select * from ISD where country = '" & StrConv(Trim(Text1.Text), VbStrConv.ProperCase) & "'")
If rs.RecordCount <> 0 Then
Frame2.Visible = True
Label7.Text = "The ISD Code for " & rs.Fields(0).Value & " is " & rs.Fields(1).Value
Else
Frame2.Visible = True
Label7.Text = "Please type the correct country name"
End If
ElseIf Option2.Checked = True And Text1.Text <> "" Then
rs = db.OpenRecordset("Select * from ISD where code = " & Val(Text1.Text))
If rs.RecordCount <> 0 Then
rs.MoveLast()
Frame2.Visible = True
rs.MoveFirst()
Label7.Text = "The Country Name for the ISD Code - " & rs.Fields(1).Value & " is " & vbCrLf
While rs.EOF <> True
Label7.Text = Label7.Text & rs.Fields(0).Value & ", "
rs.MoveNext()
End While
Else
Frame2.Visible = True
Label7.Text = "Please type the correct ISD Code"
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 Form6_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()
Form9.Show()
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -