📄 frmuserquery.frm
字号:
VERSION 5.00
Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
Begin VB.Form frmUserQuery
Caption = "用户查询"
ClientHeight = 6660
ClientLeft = 60
ClientTop = 345
ClientWidth = 9270
Icon = "frmUserQuery.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6660
ScaleWidth = 9270
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdPrint
Caption = "打印(&P)"
Default = -1 'True
Height = 375
Left = 2888
TabIndex = 5
Top = 6000
Width = 1095
End
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "frmUserQuery.frx":0442
Height = 4335
Left = 248
OleObjectBlob = "frmUserQuery.frx":0456
TabIndex = 4
Top = 840
Width = 8775
End
Begin VB.Data Data1
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 668
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 5400
Width = 7935
End
Begin VB.CommandButton cmdExit
Cancel = -1 'True
Caption = "退出(&X)"
Height = 375
Left = 5288
TabIndex = 6
Top = 6000
Width = 1095
End
Begin VB.TextBox txtInput
Height = 300
Left = 2235
TabIndex = 1
Top = 240
Width = 1935
End
Begin VB.ComboBox comStyle
Height = 300
Left = 6135
Style = 2 'Dropdown List
TabIndex = 3
Top = 240
Width = 1935
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "输入编号:"
Height = 180
Left = 1200
TabIndex = 0
Top = 300
Width = 810
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "选择类型:"
Height = 180
Left = 5100
TabIndex = 2
Top = 300
Width = 810
End
End
Attribute VB_Name = "frmUserQuery"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim strAppName As String, strSQL As String
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdPrint_Click()
Me.PrintForm
Printer.EndDoc
End Sub
Private Sub comStyle_Click()
strSQL = "select * from 主库文件 order by " & comStyle.Text
Data1.RecordSource = strSQL
Data1.Refresh
End Sub
Private Sub Data1_Reposition()
Data1.Caption = "记录:" & Data1.Recordset.AbsolutePosition + 1
End Sub
Private Sub Form_Load()
comStyle.AddItem "编号"
comStyle.AddItem "户名"
strAppName = App.Path & "\Main" & Year(Now) & Month(Now) & ".mdb"
Data1.DatabaseName = strAppName
Data1.RecordSource = "主库文件"
Data1.Refresh
End Sub
Private Sub txtInput_LostFocus()
If Not IsNumeric(txtInput) Then
MsgBox "输入错误!", vbExclamation + vbOKOnly, "用户查询"
txtInput.SetFocus
SendKeys "{Home}+{End}"
Exit Sub
End If
strSQL = "select * from 主库文件 where 编号=" & Val(txtInput)
Data1.RecordSource = strSQL
Data1.Refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -