📄 frmdown.frm
字号:
MSFlexGrid1.Visible = True
DBFD
PrBar1.Value = 0
Sta = 1
Case "business"
With UserControl11
.DisplayButton "Customer", "Customer", False, , "Customer" 'customer download
.DisplayButton "Business", "Business", False, , "Business" 'business download
.DisplayButton "Item", "Item", False, , "Item" ' ' item download
End With
ReDim Preserve BusiRc(0) As BusiC
DBFC ("busidbf")
DBF_Rec.Open "select * from f0006 "
DBF_Rec.MoveFirst
PrBar1.Max = DBF_Rec.RecordCount
MSFlexGrid1.Cols = 2
MSFlexGrid1.AddItem "BUSSINESS CODE" + Chr(9) + "BUSSINESS DESCRIPTION", 0
Do
PrBar1.Value = i
BusiRc(UBound(BusiRc)).Buscode = DBF_Rec!mcmcu
BusiRc(UBound(BusiRc)).Busdesc = "" & DBF_Rec!mcdc '
MSFlexGrid1.AddItem BusiRc(UBound(BusiRc)).Buscode + Chr(9) + BusiRc(UBound(BusiRc)).Busdesc, i + 1
ReDim Preserve BusiRc(UBound(BusiRc) + 1) As BusiC
i = i + 1
DBF_Rec.MoveNext
Loop Until DBF_Rec.EOF
Cmd_ok.Visible = True
Cmd_no.Visible = True
MSFlexGrid1.Visible = True
DBFD
PrBar1.Value = 0
Sta = 2
Case "item"
With UserControl11
.DisplayButton "Customer", "Customer", False, , "Customer" 'customer download
.DisplayButton "Business", "Business", False, , "Business" 'business download
.DisplayButton "Item", "Item", False, , "Item" ' ' item download
End With
ReDim Preserve ItemRc(0) As ItemC
DBFC ("itemdbf")
DBF_Rec.Open "select * from f4101je "
PrBar1.Max = DBF_Rec.RecordCount
DBF_Rec.MoveFirst
MSFlexGrid1.Rows = 0
MSFlexGrid1.Cols = 4
MSFlexGrid1.AddItem "BRANCH CODE" + Chr(9) + "ITEM CODE" + Chr(9) + "ITEM DESCRIPTION" + Chr(9) + "MEASUREMENT UNIT", 0
i = 0
Do While Not DBF_Rec.EOF
PrBar1.Value = i
ItemRc(UBound(ItemRc)).Bracode = DBF_Rec!ibmcu
ItemRc(UBound(ItemRc)).Itecode = DBF_Rec!imitm
ItemRc(UBound(ItemRc)).Itedesc = DBF_Rec!imdsc1 '
ItemRc(UBound(ItemRc)).Meaunit = DBF_Rec!imuom1
ItemRc(UBound(ItemRc)).Astatus = "N"
MSFlexGrid1.AddItem ItemRc(UBound(ItemRc)).Bracode + Chr(9) + Str(ItemRc(UBound(ItemRc)).Itecode) + Chr(9) + ItemRc(UBound(ItemRc)).Itedesc + Chr(9) + ItemRc(UBound(ItemRc)).Meaunit, i + 1
ReDim Preserve ItemRc(UBound(ItemRc) + 1) As ItemC
i = i + 1
DBF_Rec.MoveNext
Loop
Cmd_ok.Visible = True
Cmd_no.Visible = True
MSFlexGrid1.Visible = True
DBFD
PrBar1.Value = 0
Sta = 3
End Select
End Sub
Private Sub cmd_ok_click()
Dim i As Integer
Dim acs_rec As Recordset
Dim sSQL As String
Cmd_no.Enabled = False
With UserControl11
.DisplayButton "Customer", "Customer", True, , "Customer" 'customer download
.DisplayButton "Business", "Business", True, , "Business" 'business download
.DisplayButton "Item", "Item", True, , "Item" ' ' item download
End With
Select Case Sta
Case 1
Acs_cnt.Execute " delete * from appcus where astatus ='N'"
Set acs_rec = Acs_cnt.Execute("select * from appcus ")
If acs_rec.EOF = False Then
For i = 0 To UBound(Cusrc)
PrBar1.Max = UBound(Cusrc)
PrBar1.Value = i
acs_rec.MoveFirst
Do
If acs_rec!Cuscode = Cusrc(i).Cuscode Then
sSQL = " update appcus set " & _
" entcode = '" & gsEntCode & "', " _
& "cusdesc = '" & Cusrc(i).Cusdesc & "'," & " altname = '" & Cusrc(i).Altname & "'," _
& "mainame = '" & Cusrc(i).Mainame & "'," & " addres1 = '" & Cusrc(i).Addres1 & "'," _
& " addres2 ='" & Cusrc(i).Addres2 & "'," & " addres3 = '" & Cusrc(i).Addres3 & "'," _
& " addres4 = '" & Cusrc(i).Addres4 & "'," & "citcode = '" & Cusrc(i).Citcode & "'" _
& " where cuscode = '" & acs_rec!Cuscode & "'"
Acs_cnt.Execute (sSQL)
Exit Do
End If
acs_rec.MoveNext
Loop Until acs_rec.EOF
If acs_rec.EOF Then
Acs_cnt.Execute "insert into appcus (entcode,cuscode,cusdesc,altname,mainame,addres1,addres2,addres3,addres4,citcode,astatus)" _
& "values( '" & gsEntCode & "' ," & "'" & Cusrc(i).Cuscode & "'," _
& "'" & Cusrc(i).Cusdesc & "'," & "'" & Cusrc(i).Altname & "'," _
& "'" & Cusrc(i).Mainame & "'," & "'" & Cusrc(i).Addres1 & "'," _
& "'" & Cusrc(i).Addres2 & "'," & "'" & Cusrc(i).Addres3 & "'," _
& "'" & Cusrc(i).Addres4 & "'," & "'" & Cusrc(i).Citcode & "'," _
& "'N')"
End If
Next i
PrBar1.Value = 0
Else
For i = 0 To UBound(Cusrc)
PrBar1.Max = UBound(Cusrc)
PrBar1.Value = i
Acs_cnt.Execute "insert into appcus (entcode,cuscode,cusdesc,altname,mainame,addres1,addres2,addres3,addres4,citcode,astatus)" _
& "values( '" & gsEntCode & "' ," & "'" & Cusrc(i).Cuscode & "'," _
& "'" & Cusrc(i).Cusdesc & "'," & "'" & Cusrc(i).Altname & "'," _
& "'" & Cusrc(i).Mainame & "'," & "'" & Cusrc(i).Addres1 & "'," _
& "'" & Cusrc(i).Addres2 & "'," & "'" & Cusrc(i).Addres3 & "'," _
& "'" & Cusrc(i).Addres4 & "'," & "'" & Cusrc(i).Citcode & "'," _
& "'N')"
Next i
PrBar1.Value = 0
End If
MSFlexGrid1.Clear
acs_rec.Close
Set acs_rec = Nothing
Case 2
i = 0
sSQL = " delete * from appbus "
Acs_cnt.Execute (sSQL)
Do
PrBar1.Max = UBound(BusiRc)
PrBar1.Value = i
Acs_cnt.Execute " insert into appbus( entcode,buscode,busdesc)" _
& "values ( '" & gsEntCode & "', '" & BusiRc(i).Buscode & "'," & "'" & BusiRc(i).Busdesc & "')"
i = i + 1
Loop Until i > UBound(BusiRc)
MSFlexGrid1.Clear
PrBar1.Value = 0
' acs_rec.Close
' Set acs_rec = Nothing
Case 3
Acs_cnt.Execute " delete * from appite where astatus ='N'"
sSQL = "select * from appite order by ITECODE"
' Set acs_rec = mDB.OpenRecordset(sSQL)
Set acs_rec = Acs_cnt.Execute(sSQL)
If acs_rec.EOF = False Then
For i = 0 To UBound(ItemRc) - 1
PrBar1.Max = UBound(ItemRc)
PrBar1.Value = i
acs_rec.MoveFirst
Do
If acs_rec!Itecode = ItemRc(i).Itecode Then
sSQL = "update appite set entcode = '" & gsEntCode & "'," _
& " itedesc = '" & ItemRc(i).Itedesc & "'," _
& " meaunit = '" & ItemRc(i).Meaunit & "'" _
& " bracode = '" & ItemRc(i).Bracode & "'" _
& " where itecode = " & ItemRc(i).Itecode & ""
Acs_cnt.Execute (sSQL)
Exit Do
End If
acs_rec.MoveNext
Loop Until acs_rec.EOF
If acs_rec.EOF Then
Acs_cnt.Execute "insert into appite (entcode,bracode,itecode,itedesc,meaunit,astatus)" _
& "values ( '" & gsEntCode & "','" & ItemRc(i).Bracode & "'," & ItemRc(i).Itecode _
& ",'" & ItemRc(i).Itedesc & "','" & ItemRc(i).Meaunit _
& "'," & "'" & ItemRc(i).Astatus & "')"
End If
Next
PrBar1.Value = 0
Else
For i = 0 To UBound(ItemRc)
PrBar1.Max = UBound(ItemRc)
PrBar1.Value = i
Acs_cnt.Execute "insert into appite (entcode,bracode,itecode,itedesc,meaunit,astatus)" _
& "values ( '" & gsEntCode & "','" & ItemRc(i).Bracode & "'," & ItemRc(i).Itecode _
& ",'" & ItemRc(i).Itedesc & "','" & ItemRc(i).Meaunit _
& "'," & "'" & ItemRc(i).Astatus & "')"
Next i
PrBar1.Value = 0
End If
MSFlexGrid1.Clear
acs_rec.Close
Set acs_rec = Nothing
End Select
End Sub
'the progress bar is
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -