📄 cg_thbs_djb.frm
字号:
_Version = 393216
End
Begin MSComctlLib.ImageList ImageList1
Left = 1290
Top = 5865
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 15
ImageHeight = 15
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 5
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Cg_ThBs_DjB.frx":13673
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Cg_ThBs_DjB.frx":13BB5
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Cg_ThBs_DjB.frx":13D0F
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Cg_ThBs_DjB.frx":13E11
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Cg_ThBs_DjB.frx":1442B
Key = ""
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc_Body_General
Height = 375
Left = 4680
Top = 3015
Visible = 0 'False
Width = 3855
_ExtentX = 6800
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc_body_general"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 9
Charset = 136
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label1
Caption = "导入退货单:"
BeginProperty Font
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 3
Left = 8250
TabIndex = 42
Top = 1980
Width = 1485
End
Begin VB.Label Label1
Caption = "总计金额:"
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 5
Left = 2970
TabIndex = 41
Top = 6525
Width = 1155
End
Begin VB.Label Label1
Caption = "数量总计:"
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 4
Left = 6930
TabIndex = 40
Top = 6525
Width = 1185
End
End
Attribute VB_Name = "Cg_ThBs_DjB"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*****************************************************************************************
'* 曹汉华 2004.6.17 编写 汇能科技开发有限公司 *
'*****************************************************************************************
Dim hla, cgdbh_Ado, Combo6_Data, Combo7_data, Combo8, Combo9, Dr_ShD As Recordset
Dim N As Long
Dim Sh_Zj, th_Ys As Double
Dim Sh_TJ As Recordset
Dim Tjbz As Boolean
Private Sub CMd_Find_Click()
On Error Resume Next
Set CX_FrM_SjY = Cg_ThBs_DjB.AdoprimaryRs
CX_SJy = "select * from cg_shdt where not gysbh is null and left(shdbh,2)<>'SH'"
With SEC_Dialog
.Combo1(0).Clear
.Combo1(1).Clear
.Combo1(0).AddItem ("gysbh(供应商编号)")
.Combo1(1).AddItem ("gysbh(供应商编号)")
.Combo1(0).AddItem ("gysmc(供应商名称)")
.Combo1(1).AddItem ("gysmc(供应商名称)")
.Combo1(0).AddItem ("shdbh(收货单号)")
.Combo1(1).AddItem ("shdbh(收货单号)")
.Combo1(0).AddItem ("lhdh(来货单号)")
.Combo1(1).AddItem ("lhdh(来货单号)")
.Combo1(0).AddItem ("bmmc(收货部门)")
.Combo1(1).AddItem ("bmmc(收货部门)")
End With
Load SEC_Dialog
SEC_Dialog.Show 1
End Sub
Private Sub CmD_SH_Click()
Dim Sh_Dh As String
Sh_Dh = Text1(0).Text
DB.Execute "update cg_shdt set sh = '已审' where shdbh='" & Text1(0).Text & "'"
AdoprimaryRs.Recordset.Requery
AdoprimaryRs.Recordset.Find ("shdbh='" & Sh_Dh & "'")
End Sub
Private Sub cmdnext_Click() '向后
On Error GoTo GoNextError
If Not AdoprimaryRs.Recordset.EOF Then AdoprimaryRs.Recordset.MoveNext
If AdoprimaryRs.Recordset.EOF And AdoprimaryRs.Recordset.RecordCount > 0 Then
Beep
AdoprimaryRs.Recordset.MoveLast
End If
Exit Sub
GoNextError:
MsgBox Err.Description
End Sub
Private Sub CmdPrint_Click()
If Trim(Text1(0).Text) = "" Then
Exit Sub
Else
Cg_SHd_rPt.HZJe.Caption = HZJe(Val(Text1(5).Text)) + "(大写金额)"
Cg_SHd_rPt.DataControl1.ConnectionString = Conn_Str
Cg_SHd_rPt.DataControl1.Source = "select cg_shdt.*,cg_shd.* from cg_shd inner join cg_shdt on cg_shd.shdbh=cg_shdt.shdbh where cg_shd.shdbh='" & Text1(0).Text & "'"
Cg_SHd_rPt.Show VBRUN.FormShowConstants.vbModal
End If
End Sub
Private Sub Cmdqd_Click() '首端
If AdoprimaryRs.Recordset.RecordCount > 0 Then
If AdoprimaryRs.BOFAction = False Then
AdoprimaryRs.Recordset.MoveFirst
Else
AdoprimaryRs.Recordset.MoveNext
End If
Else
Exit Sub
End If
End Sub
Private Sub Cmdreturn_Click()
Unload Me
End Sub
Private Sub cmdxq_Click() '向前
On Error GoTo GoPrevError
If Not AdoprimaryRs.Recordset.BOF Then AdoprimaryRs.Recordset.MovePrevious
If AdoprimaryRs.Recordset.BOF And AdoprimaryRs.Recordset.RecordCount > 0 Then
Beep
AdoprimaryRs.Recordset.MoveFirst
End If
Exit Sub
GoPrevError:
MsgBox Err.Description
End Sub
Private Sub cmdmd_Click() '末端
If AdoprimaryRs.Recordset.RecordCount > 0 Then
If AdoprimaryRs.Recordset.EOF = False Then
AdoprimaryRs.Recordset.MoveLast
Else
AdoprimaryRs.Recordset.MovePrevious
End If
Else
Exit Sub
End If
End Sub
Private Sub Combo_Click(Index As Integer)
On Error Resume Next
If Cmdadd.Enabled = False Then
If Index = 0 Then
Set hla = New Recordset
hla.Open "select distinct * from sys_gyszl where gysbh='" & Trim(Combo(0).Text) & "' and (gysbh<>'' or gysbh is null)", DB, adOpenStatic, adLockOptimistic
AdoprimaryRs.Recordset.Fields("gysmc").Value = hla!gysmc
AdoprimaryRs.Recordset.Fields("phone").Value = hla!Phone
AdoprimaryRs.Recordset.Fields("bizh").Value = Trim(hla!bizh)
AdoprimaryRs.Recordset.Fields("hl").Value = hla!hl
AdoprimaryRs.Recordset.Fields("shdz").Value = hla!dizhi
AdoprimaryRs.Recordset.Fields("fax").Value = hla!Fax
AdoprimaryRs.Recordset.Fields("fkfs").Value = hla!fkfs
AdoprimaryRs.Recordset.Fields("zffs").Value = hla!zffs
Call Shd_Dr
End If
End If
If Index = 2 Then '导入采购单记录
Set Dr_ShD = New Recordset
Dr_ShD.Open "select * FROM cg_thd where thdh='" & Trim(Combo(2).Text) & "'and (wanch is null or wanch='' OR WANCH='未完成')", DB, adOpenStatic, adLockReadOnly
If Dr_ShD.RecordCount > 0 Then
Dr_ShD.MoveFirst
For i = 1 To Dr_ShD.RecordCount
Set Sh_TJ = New Recordset
Sh_TJ.Open "select sum(isnull(sl,0)) as shsl from cg_shd where gysbh='" & Dr_ShD!gysbh & "' and cgdbh='" & Dr_ShD.Fields("cgdbh").Value & "' and ylbh='" & Dr_ShD.Fields("ylbh").Value & "' and ylmc='" & Dr_ShD.Fields("ylmc").Value & "' and gg='" & Dr_ShD.Fields("gg").Value & "'AND yanse='" & Dr_ShD.Fields("yanse").Value & "' and caizh='" & Dr_ShD.Fields("caizh").Value & "'", DB, adOpenStatic
If Sh_TJ.RecordCount > 0 Then
Sh_TJ.MoveFirst
If Not IsNull(Sh_TJ!shsl) Then
Sh_Zj = Sh_TJ!shsl
Else
Sh_Zj = 0
End If
End If
Set Sh_TJ = New Recordset
Sh_TJ.Open "select sum(isnull(sl,0)) as shsl from cg_shd where gysbh='" & Dr_ShD!gysbh & "' and thdh='" & Dr_ShD.Fields("thdh").Value & "' and ylbh='" & Dr_ShD.Fields("ylbh").Value & "' and ylmc='" & Dr_ShD.Fields("ylmc").Value & "' and gg='" & Dr_ShD.Fields("gg").Value & "'AND yanse='" & Dr_ShD.Fields("yanse").Value & "' and caizh='" & Dr_ShD.Fields("caizh").Value & "'", DB, adOpenStatic
If Sh_TJ.RecordCount > 0 Then
Sh_TJ.MoveFirst
If Not IsNull(Sh_TJ!shsl) Then
th_Ys = Sh_TJ!shsl
Else
th_Ys = 0
End If
End If
DB.Execute "insert into cg_shd(shdbh,ylbh,ylmc,cplb,gyslh,caizh,yanse,dj,cgdbh,gysbh,sl,cgsl,shsl,dw,lhdh,djrq,gg,bacp,thdh,thsl,thys) values('" & Text1(0).Text & "','" & Dr_ShD.Fields("ylbh").Value & "','" & Dr_ShD.Fields("ylmc").Value & "','" & Dr_ShD.Fields("cplb").Value & "','" & Dr_ShD.Fields("gyslh").Value & "','" & Dr_ShD.Fields("caizh").Value & "'" & _
",'" & Dr_ShD.Fields("yanse").Value & "','" & Dr_ShD.Fields("dj").Value & "','" & Dr_ShD.Fields("cgdbh").Value & "','" & Dr_ShD.Fields("gysbh").Value & "',0,'" & Dr_ShD.Fields("cgsl").Value & "'," & Sh_Zj & ",'" & Dr_ShD.Fields("dw").Value & "','" & Text1(7).Text & "','" & CVDate(Text1(1).Text) & "','" & Dr_ShD.Fields("gg").Value & "','" & Dr_ShD.Fields("bacp").Value & "','" & Dr_ShD.Fields("thdh").Value & "','" & Dr_ShD.Fields("sl").Value & "'," & th_Ys & ")"
Dr_ShD.MoveNext
Next i
End If
Adodc_body_general.Refresh
Call cmdOK_Click
Call Shd_Dr
Call cmdEdit_Click
End If
End Sub
Private Sub combo_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 13 Then ' 按回车
KeyAscii = 0
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker1_Change()
If Check1.Value = 0 Then
AdoprimaryRs.ConnectionString = Conn_Str
AdoprimaryRs.RecordSource = "SELECT * FROM cg_shdt WHERE left(shdbh,2)<>'SH' and YEAR(djRQ)='" & DTPicker1.Year & "' AND MONTH(djRQ)='" & DTPicker1.Month & "' ORDER BY shdbh"
Else
AdoprimaryRs.ConnectionString = Conn_Str
AdoprimaryRs.RecordSource = "SELECT * FROM cg_shdt WHERE left(shdbh,2)<>'SH' and djRQ='" & DTPicker1.Value & "' order BY shdbh"
End If
AdoprimaryRs.Refresh
End Sub
Private Sub Form_Load() '载入数据
Me.Width = main_FRM.Picture1.Width - 30
Me.Top = main_FRM.ActiveBar21.Bands("Band7").Height * 2.5 - 65
Me.Height = main_FRM.Picture1.Height - 300
Me.Left = main_FRM.Picture1.Left + 15
Call Cob_Load
If SH_Right = True Then
CmD_SH.Visible = True
Else
CmD_SH.Visible = False
End If
Me.DTPicker1.Value = VBA.Date
AdoprimaryRs.ConnectionString = Conn_Str
AdoprimaryRs.RecordSource = "select * FROM cg_shdt where left(shdbh,2)<>'SH' and djrq='" & VBA.Date & "'"
AdoprimaryRs.Refresh
For i = 0 To Text1.Count - 1
Text1(i).Enabled = False
Next i
For i = 0 To Combo.Count - 1
Combo(i).Enabled = False
Next i
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) '非法退出
If Cmdcancel.Enabled = True Then
If UnloadMode <> VBRUN.QueryUnloadConstants.vbFormCode Then
Cancel = 1
Exit Sub
End If
End If
End Sub
Private Sub T_Sh_Change()
If T_Sh.Text = "已审" And SH_Right = False Then
Cmdedit.Visible = False
Cmddelete.Visible = False
Else
Cmdedit.Visible = True
Cmddelete.Visible = True
End If
End Sub
Private Sub T_Sh_GotFocus()
SendKeys "{TAB}"
End Sub
Private Sub TDBGrid1_AfterColUpdate(ByVal ColIndex As Integer)
If Cmdadd.Enabled = False And Trim(Adodc_body_general.Recordset.Fields("SHDBH").Value) <> "" Then
' Set Sh_TJ = New Recordset
' Sh_TJ.Open "select sum(isnull(sl,0)) as shsl from cg_shd where shdbh<>'" & Text1(0).Text & "' and thdh='" & Trim(TDBGrid1.Columns(13).Text) & "' and ylbh='" & Trim(TDBGrid1.Columns(0).Text) & "' and ylmc='" & Trim(TDBGrid1.Columns(1).Text) & "' and gg='" & Trim(TDBGrid1.Columns(2).Text) & "'AND yanse='" & Trim(TDBGrid1.Columns(4).Text) & "' and caizh='" & Trim(TDBGrid1.Columns(3).Text) & "'", DB, adOpenStatic
' If Sh_TJ.RecordCount > 0 Then
' Sh_TJ.MoveFirst
' If Not IsNull(Sh_TJ!shsl) Then
' Sh_Zj = Sh_TJ!shsl
' Else
' Sh_Zj = 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -