📄 grid of buyer.frm
字号:
Height = 345
Left = 1920
TabIndex = 4
Top = 4560
Width = 1455
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 = 495
Left = 720
TabIndex = 3
Top = 4440
Width = 1095
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 = 495
Left = 3960
TabIndex = 2
Top = 4440
Width = 1095
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 = 360
TabIndex = 1
Top = 4080
Width = 7215
End
Begin VB.Image Image3
Height = 645
Left = 7555
Picture = "grid of buyer.frx":0015
Top = 6130
Width = 555
End
Begin VB.Label Label2
BackColor = &H80000013&
Height = 6255
Left = 7635
TabIndex = 12
Top = 0
Width = 375
End
Begin VB.Image Image2
Height = 855
Left = -1080
Picture = "grid of buyer.frx":1327
Top = 6720
Width = 8775
End
Begin VB.Image Image1
Height = 7560
Left = 7680
Picture = "grid of buyer.frx":19A65
Top = 0
Width = 1800
End
Begin VB.Label Label1
BackColor = &H80000013&
Caption = "Search Customer"
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 = 2280
TabIndex = 0
Top = 240
Width = 3855
End
End
Attribute VB_Name = "Form21"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public callingform As Object
Private Sub code_Change()
'If code.Text = "" Then
'Adodc1.CommandType = adCmdText
'Adodc1.RecordSource = "SELECT * FROM Customer_Table"
'Adodc1.Refresh
'Exit Sub
'End If
'Adodc1.CommandType = adCmdText
'Adodc1.RecordSource = "SELECT * FROM Customer_Table WHERE Cust_Id ='" & 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 Command1_Click()
If callingform.Name = "MDIForm1" Then
Exit Sub
End If
'///////////////////////////
If callingform.Name = "Form25" Then
callingform.Text2.Text = Adodc1.Recordset.Fields(0)
Unload Me
End If
'//////////////////////////////////
If callingform.Name = "Form5" Then
callingform.csid1(0).Text = Adodc1.Recordset.Fields(0)
Unload Me
End If
'/////////////////////////////////
If callingform.Name = "Form8" Then
callingform.csid3(0).Text = Adodc1.Recordset.Fields(0)
Unload Me
End If
'//////////////////////////////////
If callingform.Name = "Form28" Then
callingform.Text2.Text = Adodc1.Recordset.Fields("Cust_Id")
callingform.Text7.Text = Adodc1.Recordset.Fields("Cust_Name")
Unload Me
End If
'////////////////////////////////////
'//////////////////////////////////
If callingform.Name = "Form4" Then
callingform.b.Text = Adodc1.Recordset.Fields("Cust_Id")
callingform.a.Text = Adodc1.Recordset.Fields("Cust_Name")
Unload Me
End If
'////////////////////////////////////
If callingform.Name = "Form20" Then
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "No Record Exists"
Exit Sub
Else
callingform.buyercode.Text = Adodc1.Recordset.Fields("Cust_Id")
callingform.buyername.Text = Adodc1.Recordset.Fields("Cust_Name")
callingform.buyeraddr.Text = Adodc1.Recordset.Fields("Cust_Addr")
callingform.buyerphno.Text = Adodc1.Recordset.Fields("Cust_Ph#")
Unload Me
End If
End If
'//////////////////////////////////
If callingform.Name = "Form32" Then
callingform.b.Text = Adodc1.Recordset.Fields("Cust_Id")
callingform.a.Text = Adodc1.Recordset.Fields("Cust_Name")
Unload Me
End If
'////////////////////////////////////
'//////////////////////////////////
If callingform.Name = "Form33" Then
callingform.b.Text = Adodc1.Recordset.Fields("Cust_Id")
callingform.a.Text = Adodc1.Recordset.Fields("Cust_Name")
Unload Me
End If
'/////////////////////////////////////
'//////////////////////////////////
If callingform.Name = "Form35" Then
callingform.b.Text = Adodc1.Recordset.Fields("Cust_Id")
callingform.a.Text = Adodc1.Recordset.Fields("Cust_Name")
Unload Me
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub nam_Change()
'Adodc1.CommandType = adCmdText
'Adodc1.RecordSource = "SELECT * FROM Customer_Table WHERE Cust_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
End If
End Sub
Private Sub Option1_Click()
If Option1.Enabled = True Then
nam.Enabled = True
code.Enabled = False
code.Text = ""
nam.Text = ""
nam.SetFocus
End If
End Sub
Private Sub Option2_Click()
If Option2.Enabled = True Then
code.Enabled = True
nam.Enabled = False
code.Text = ""
nam.Text = ""
code.SetFocus
End If
End Sub
Private Sub search_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
MsgBox "Please enter the Customer Code"
code.SetFocus
Exit Sub
End If
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * FROM Customer_Table WHERE Cust_Id ='" & Val(code.Text) & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox " Record Not Found"
code.SetFocus
End If
Else
If Option1.Value = True Then
If nam.Text = "" Then
MsgBox "Please enter the Customer Name"
nam.SetFocus
Exit Sub
End If
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * FROM Customer_Table WHERE Cust_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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -