📄 grid of supplier.frm
字号:
TabIndex = 3
Top = 4560
Width = 1215
End
Begin VB.OptionButton Option2
BackColor = &H80000013&
Caption = "Code"
BeginProperty Font
Name = "Times New Roman"
Size = 11.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 2
Top = 4500
Width = 975
End
Begin VB.OptionButton Option1
BackColor = &H80000013&
Caption = "Name"
BeginProperty Font
Name = "Times New Roman"
Size = 11.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3720
TabIndex = 1
Top = 4500
Width = 1215
End
Begin VB.Frame Frame1
BackColor = &H80000013&
Caption = "Search By"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 600
TabIndex = 0
Top = 4080
Width = 6975
End
Begin VB.Image Image3
Height = 645
Left = 7680
Picture = "grid of supplier.frx":0015
Top = 6125
Width = 555
End
Begin VB.Label Label3
BackColor = &H80000013&
Height = 6255
Left = 7755
TabIndex = 13
Top = 0
Width = 375
End
Begin VB.Label Label2
Height = 6135
Left = 77860
TabIndex = 12
Top = 0
Width = 375
End
Begin VB.Image Image2
Height = 855
Left = -960
Picture = "grid of supplier.frx":1327
Top = 6720
Width = 8775
End
Begin VB.Image Image1
Height = 7560
Left = 7800
Picture = "grid of supplier.frx":19A65
Top = 0
Width = 1800
End
Begin VB.Label Label1
BackColor = &H80000013&
Caption = "Search Supplier"
BeginProperty Font
Name = "Times New Roman"
Size = 24
Charset = 0
Weight = 700
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 1920
TabIndex = 9
Top = 360
Width = 3735
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public callingform As Object
Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Private Sub code_Change()
'If code.Text = "" Then
' Adodc1.CommandType = adCmdText
' Adodc1.RecordSource = "SELECT * FROM Supplier_Table"
' Adodc1.Refresh
' Exit Sub
' End If
' Adodc1.CommandType = adCmdText
' Adodc1.RecordSource = "SELECT * FROM Supplier_Table WHERE Sup_Code='" & Val(code.Text) & "'"
' Adodc1.Refresh
End Sub
Private Sub code_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Or KeyAscii = 13) Then
KeyAscii = 0
'MsgBox "Please Enter integer Value"
End If
If KeyAscii = 13 Then
supphno.SetFocus
End If
End Sub
Private Sub name_KeyPress(KeyAscii As Integer)
If (KeyAscii >= 48 And KeyAscii <= 57) Then
KeyAscii = 0
' MsgBox "Please Enter Characters"
End If
If KeyAscii = 13 Then
pname.SetFocus
End If
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
'/////////////////////////////
If callingform.Name = "Form15" Then
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "No Record Exists"
Exit Sub
Else
callingform.supcode.Text = Adodc1.Recordset.Fields("Sup_Code")
callingform.supname.Text = Adodc1.Recordset.Fields("Sup_Name")
callingform.supaddr.Text = Adodc1.Recordset.Fields("Sup_Addr")
callingform.supphno.Text = Adodc1.Recordset.Fields("Sup_Ph#")
Unload Me
End If
End If
'//////////////////////////////////
If callingform.Name = "Form22" Then
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "No Record Exists"
Exit Sub
Else
callingform.b.Text = Adodc1.Recordset.Fields(0)
callingform.a.Text = Adodc1.Recordset.Fields(1)
Unload Me
End If
End If
'/////////////////////////////////////
'//////////////////////////////////
If callingform.Name = "Form23" Then
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "No Record Exists"
Exit Sub
Else
callingform.b.Text = Adodc1.Recordset.Fields(0)
callingform.a.Text = Adodc1.Recordset.Fields(1)
Unload Me
End If
End If
'//////////////////
If callingform.Name = "MDIForm1" Then
Exit Sub
End If
'///////////////////////////
If callingform.Name = "Form25" Then
callingform.Text2.Text = Adodc1.Recordset.Fields(0)
callingform.Text5.Text = Adodc1.Recordset.Fields(1)
Unload Me
End If
End Sub
Private Sub Command3_Click()
End Sub
Private Sub Command4_Click()
If Option2.Value = False And Option1.Value = False Then
MsgBox "First select an Option"
Exit Sub
End If
If Option2.Value = True Then
If code.Text = "" Then
'Adodc1.CommandType = adCmdText
'Adodc1.RecordSource = "SELECT * FROM Supplier_Table"
' Adodc1.Refresh
MsgBox "Please enter the Supplier Code"
code.SetFocus
Exit Sub
End If
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * FROM Supplier_Table WHERE Sup_Code='" & Val(code.Text) & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox " Record Not Found"
code.SetFocus
Exit Sub
End If
Else
If Option1.Value = True Then
If nam.Text = "" Then
MsgBox "Please enter the Supplier Name"
nam.SetFocus
Exit Sub
End If
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * FROM Supplier_Table WHERE Sup_Name LIKE '" & nam.Text & "%'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox " Record Not Found"
nam.SetFocus
Exit Sub
End If
End If
End If
End Sub
Private Sub nam_Change()
'Adodc1.CommandType = adCmdText
'Adodc1.RecordSource = "SELECT * FROM Supplier_Table WHERE Sup_Name LIKE '" & nam.Text & "%'"
'Adodc1.Refresh
End Sub
Private Sub nam_KeyPress(KeyAscii As Integer)
If Not (KeyAscii = 8 Or KeyAscii >= 65 And KeyAscii <= 90 Or KeyAscii >= 97 And KeyAscii <= 122 Or KeyAscii = 32 Or KeyAscii = 46) Then
KeyAscii = 0
'8=back space
''13=enter
'32=space bar
'46=point
End If
End Sub
Private Sub Option1_Click()
If Option1.Enabled = True Then
nam.Enabled = True
code.Enabled = False
code.Text = ""
nam.Text = ""
End If
End Sub
Private Sub Option2_Click()
If Option2.Enabled = True Then
code.Enabled = True
nam.Enabled = False
code.Text = ""
nam.Text = ""
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -