注意 在这个ERP系统中 要把表单头 和表单身 在数据库中 分开 保存
你问为什么?当然是让 数据库的 单个表数据量小一点 C/S 结构中数据流量 小一点 (数据库 我没有做任何触发器 图省事了 ) 表单头 和表单身 在数据库中 分开 保存 互相之间的联系 就是 表单号 字段 下面继续以13楼的 form_dd 做例子 先说 formdd_load 的源程序 Me.Left = (Screen.Width - Me.Width) / 2 Me.Top = (Screen.Height - Me.Height) / 2‘这一段 是让你的程序窗口 显示在屏幕中间 Text7.Visible = False Command1.Enabled = False Adodc1.Visible = False Adodc2.Visible = False Label14.Visible = False Label21.Visible = False Label22.Visible = False Label15.Caption = user Command13.Visible = False Command5.Visible = False Combo2.Text = "" Combo2.Visible = False DT1.Value = Date DT2.Value = Date + 14 ’此处默认交货期 为订单日延后14天 Label16.Caption = "CO" & Format(Now, "YYMMDD") & Format(Time, "HHMMSS")‘最偷懒的订单号自动生成办法 是C0+年月日+时分秒 呵呵呵呵 Text4.Text = "" Label11.Caption = "" Label12.Caption = "" Label18.Caption = "" Label23.Caption = "" Combo1.Text = "" Adodc1.ConnectionString = db '把所有客户添加到COMBO1中’用ADODC 来连接数据库 DB 已经在公用模块中声明了 Adodc1.RecordSource = "select 客户名称 from tb_kh" Adodc1.Refresh X = Adodc1.Recordset.RecordCount If X > 0 Then For i = 1 To X Combo1.AddItem (Adodc1.Recordset.Fields("客户名称")) If i < X Then Adodc1.Recordset.MoveNext Next End If MS1.Row = 1’给MSFLEXGRID控件初始化 MS1.Col = 1 MS1.Cols = 15 MS1.ColWidth(0) = 12 * 25 * 1.5 '设置单元格格式, MS1.ColWidth(1) = 12 * 25 * 4 MS1.ColWidth(2) = 12 * 25 * 5 MS1.ColWidth(3) = 12 * 25 * 4 MS1.ColWidth(4) = 12 * 25 * 3 MS1.ColWidth(5) = 12 * 25 * 2.5 MS1.ColWidth(6) = 12 * 25 * 2 MS1.ColWidth(7) = 12 * 25 * 3 MS1.ColWidth(8) = 12 * 25 * 3 MS1.ColWidth(9) = 12 * 25 * 3 MS1.ColWidth(10) = 12 * 25 * 2 MS1.ColWidth(11) = 12 * 25 * 2 MS1.ColWidth(12) = 12 * 25 * 2.5 MS1.ColWidth(13) = 12 * 25 * 2.5 MS1.ColWidth(14) = 12 * 25 * 10 MS1.FixedRows = 1: MS1.FixedCols = 1 MS1.TextMatrix(0, 0) = "序号" MS1.TextMatrix(0, 1) = "产品编号" MS1.TextMatrix(0, 2) = "产品名称" MS1.TextMatrix(0, 3) = "电源供应" MS1.TextMatrix(0, 4) = "气源供应" MS1.TextMatrix(0, 5) = "功率KW" MS1.TextMatrix(0, 6) = "颜色" MS1.TextMatrix(0, 7) = "进料口mm" MS1.TextMatrix(0, 8) = "出料口mm" MS1.TextMatrix(0, 9) = "包装" MS1.TextMatrix(0, 10) = " 数量" MS1.TextMatrix(0, 11) = " 单位" MS1.TextMatrix(0, 12) = "单价" MS1.TextMatrix(0, 13) = "小计" MS1.TextMatrix(0, 14) = " 序列号" For i = 1 To 10 呵呵 给每一个MS1标个行号 默认10行 MS1.TextMatrix(i, 0) = i Next Combo2.Width = MS1.CellWidth 让COMBO2 浮自MSFLEXDRID 上 Combo2.Left = MS1.CellLeft + MS1.Left Combo2.Top = MS1.CellTop + MS1.Top Text7.Text = "" '在msflexgrid上搞个TEXT 奶奶的想了很久 个破MSFLEXGRID 只读个毛 SHIT Text7.Width = MS1.CellWidth: Text7.Height = MS1.CellHeight Text7.Left = MS1.CellLeft + MS1.Left Text7.Top = MS1.CellTop + MS1.Top 这一段 是精华 用它来实现 向MSFLEXGRID 中输入 数据 为什么?(因为MSFLEXGRID 是免费的 呵呵 ) End Sub |
|