1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号 from MedInfor where usefullife <' " & Trim(Text13) & " ' "
Adodc1.Refresh
End If
If Adodc1.Recordset.EOF Then
MsgBox "无此信息!", , "提示"
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号 from MedInfor "
Adodc1.Refresh
End If
End Sub
Private Sub Command7_Click()
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF Then
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号 from MedInfor "
Adodc1.Refresh
MsgBox "当前记录为第一条", , "提示"
End If
End Sub
Private Sub Command8_Click()
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
Adodc1.RecordSource = "select medicinecode as 药品编码,medicinename as 药品名称,medkindcode as 药品类别代码,price as 售价,listprice as 厂价,stocknum as 库存量,unit as 单位,usefullife as 有效期至,ratifycode as 批准文号 from MedInfor "
Adodc1.Refresh
MsgBox "当前记录为最后一条", , "提示"
End If
End Sub
Private Sub Option4_Click()
Combo1.Enabled = False
Text13.Text = Date$
End Sub
5.销售记录查询代码
Option Explicit
Private Sub Command1_Click()
If Option1 Then
Adodc1.RecordSource = " select saleno as 销售编码,amount as 总额,saledate as 销售日期,workno as 销售员编号 from salemaintable where saleno='" & Trim(Text12.Text) & "'"
Adodc1.Refresh
End If
If Option2 Then
Adodc1.RecordSource = " select saleno as 销售编码,medicinecode AS 药品编码,medicinename as 药品名称,number as 数量,unit as 单位,price as 单价,amount as 总额 from salechildtable where saleno='" & Trim(Text12.Text) & "'"
Adodc1.Refresh
End If
If Option3 Then
Adodc1.RecordSource = " select salemaintable.saleno as 销售编码,medicinecode AS 药品编码,medicinename as 药品名称,number as 数量,unit as 单位,price as 单价,salechildtable.amount as 总额,saledate as 销售日期,workno as 销售员编号 from salemaintable,salechildtable where salemaintable.saleno=salechildtable.saleno "
Adodc1.Refresh
End If
If Adodc1.Recordset.EOF Then
MsgBox "无次信息", , "提示"
Adodc1.RecordSource = " select salemaintable.saleno as 销售编码,medicinecode AS 药品编码,medicinename as 药品名称,number as 数量,unit as 单位,price as 单价,salechildtable.amount as 总额,saledate as 销售日期,workno as 销售员编号 from salemaintable,salechildtable where salemaintable.saleno=salechildtable.saleno "
Adodc1.Refresh
End If
End Sub
6.供应商信息维护代码及查询代码
对供应商信息的添加、删除等功能实现代码类似于药品信息的添加、删除等操作,在此就不再赘述
Private Sub Command6_Click()
If Option1 Then
Adodc1.RecordSource = "select * from firminfor where firmcode= '" & Text6 & "'"
Adodc1.Refresh
End If
If Option2 Then
Adodc1.RecordSource = "select * from firminfor where firmname= '" & Text7 & "'"
Adodc1.Refresh
End If
If Option3 Then
On Error Resume Next
Adodc1.RecordSource = " Select * From FirmInfor Where city= '" & Trim(Text8.Text) & "'"
Adodc1.Refresh
End If
If Adodc1.Recordset.EOF Then
MsgBox "无此信息", , "提示"
Adodc1.RecordSource = "firminfor"
Adodc1.Refresh
End If
End Sub
7.用户信息的维护及查询代码
对用户信息的添加、删除等功能实现代码类似于药品信息的添加、
VB+免费的,医药管理系统(八)相关范文