📄 search_a.bas
字号:
Attribute VB_Name = "search_a"
'查询书籍信息
Sub a_search_books(s_key As String, s_type As String)
Select Case s_type
Case "书名"
GoTo s_name
Case "作者"
GoTo s_author
Case "类型"
GoTo s_type
Case "出版社"
GoTo s_pub
End Select
Exit Sub
s_name:
info_a_form.a_books_info_source.RecordSource = "select books_id as ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_have as 在库否, b_address 存放位置 from books where b_name like '" & s_key & "'"
Exit Sub
s_author:
info_a_form.a_books_info_source.RecordSource = "select books_id as ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_have as 在库否, b_address 存放位置 from books where b_author like '" & s_key & "'"
Exit Sub
s_type:
info_a_form.a_books_info_source.RecordSource = "select books_id as ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_have as 在库否, b_address 存放位置 from books where b_type like '" & s_key & "'"
Exit Sub
s_pub:
info_a_form.a_books_info_source.RecordSource = "select books_id as ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_have as 在库否, b_address 存放位置 from books where b_pub like '" & s_key & "'"
Exit Sub
End Sub
'模糊查询书籍信息
Sub a_search_books_blur(s_key As String, s_type As String)
Select Case s_type
Case "书名"
GoTo s_name
Case "作者"
GoTo s_author
Case "类型"
GoTo s_type
Case "出版社"
GoTo s_pub
End Select
Exit Sub
s_name:
info_a_form.a_books_info_source.RecordSource = "select books_id as ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_have as 在库否, b_address 存放位置 from books where b_name like '%" & s_key & "%'"
Exit Sub
s_author:
info_a_form.a_books_info_source.RecordSource = "select books_id as ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_have as 在库否, b_address 存放位置 from books where b_author like '%" & s_key & "%'"
Exit Sub
s_type:
info_a_form.a_books_info_source.RecordSource = "select books_id as ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_have as 在库否, b_address 存放位置 from books where b_type like '%" & s_key & "%'"
Exit Sub
s_pub:
info_a_form.a_books_info_source.RecordSource = "select books_id as ID,b_name as 书名,b_author as 作者,b_type as 类型 ,b_isbn as ISBN,b_pub as 出版社,b_p_date as 出版日期,b_price as 价格, b_reg_date as 入库日期,b_have as 在库否, b_address 存放位置 from books where b_pub like '%" & s_key & "%'"
Exit Sub
End Sub
'=============================================================================================================
'查询用户信息
Sub a_search_users(u_key As String, u_type As String)
Select Case u_type
Case "用户ID"
GoTo u_id
Case "姓名"
GoTo u_name
Case "部门"
GoTo u_type
Case "注册日期"
GoTo u_reg
End Select
Exit Sub
u_id:
info_a_form.a_users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注,u_oper as 操作员 from users where users_id like '" & u_key & "'"
Exit Sub
u_name:
info_a_form.a_users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注,u_oper as 操作员 from users where u_name like '" & u_key & "'"
Exit Sub
u_type:
info_a_form.a_users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注,u_oper as 操作员 from users where u_dep like '" & u_key & "'"
Exit Sub
u_reg:
info_a_form.a_users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注,u_oper as 操作员 from users where u_reg_date like '" & u_key & "'"
Exit Sub
End Sub
'模糊查询用户信息
Sub a_search_users_blur(u_key As String, u_type As String)
Select Case u_type
Case "用户ID"
GoTo u_id
Case "姓名"
GoTo u_name
Case "部门"
GoTo u_type
Case "注册日期"
GoTo u_reg
End Select
Exit Sub
u_id:
info_a_form.a_users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注,u_oper as 操作员 from users where users_id like '%" & u_key & "%'"
Exit Sub
u_name:
info_a_form.a_users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注,u_oper as 操作员 from users where u_name like '%" & u_key & "%'"
Exit Sub
u_type:
info_a_form.a_users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注,u_oper as 操作员 from users where u_dep like '%" & u_key & "%'"
Exit Sub
u_reg:
info_a_form.a_users_info_source.RecordSource = "select users_id as 用户ID,u_name as 姓名,u_sex as 性别,u_dep as 部门 ,u_phone as 联系电话, u_address as 联系地址,u_reg_date as 注册日期,u_text as 备注,u_oper as 操作员 from users where u_reg_date like '%" & u_key & "%'"
Exit Sub
End Sub
'===========================================================================================================
'=============================================================================================================
'查询管理员信息
Sub a_search_admin(u_key As String, u_type As String)
Select Case u_type
Case "管理员ID"
GoTo u_id
Case "姓名"
GoTo u_name
Case "管理员类型"
GoTo u_type
End Select
Exit Sub
u_id:
info_a_form.a_admin_info_source.RecordSource = "select admin_id as 管理员ID,a_name as 姓名,a_pwd as 密码,a_type as 管理员类型 from admin where admin_id like '" & u_key & "'"
Exit Sub
u_name:
info_a_form.a_admin_info_source.RecordSource = "select admin_id as 管理员ID,a_name as 姓名,a_pwd as 密码,a_type as 管理员类型 from admin where a_name like '" & u_key & "'"
Exit Sub
u_type:
info_a_form.a_admin_info_source.RecordSource = "select admin_id as 管理员ID,a_name as 姓名,a_pwd as 密码,a_type as 管理员类型 from admin where a_type like '" & u_key & "'"
Exit Sub
End Sub
'模糊查询管理员信息
Sub a_search_admin_blur(u_key As String, u_type As String)
Select Case u_type
Case "管理员ID"
GoTo u_id
Case "姓名"
GoTo u_name
Case "管理员类型"
GoTo u_type
End Select
Exit Sub
u_id:
info_a_form.a_admin_info_source.RecordSource = "select admin_id as 管理员ID,a_name as 姓名,a_type as 管理员类型 from admin where admin_id like '%" & u_key & "%'"
Exit Sub
u_name:
info_a_form.a_admin_info_source.RecordSource = "select admin_id as 管理员ID,a_name as 姓名,a_type as 管理员类型 from admin where a_name like '%" & u_key & "%'"
Exit Sub
u_type:
info_a_form.a_admin_info_source.RecordSource = "select admin_id as 管理员ID,a_name as 姓名,a_type as 管理员类型 from admin where a_type like '%" & u_key & "%'"
Exit Sub
End Sub
'===========================================================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -