Office中国论坛/Access中国论坛
标题:
哪位大侠能给我一点源码......
[打印本页]
作者:
access001
时间:
2003-3-7 23:36
标题:
哪位大侠能给我一点源码......
各位大侠:
我是刚刚学习VBA,很想看看别人的源码,有记录操作,打印等等功能越多越好(是不是很贪心......)不知哪位大侠能满足我的心愿,(最好是非绑定控件)。
作者:
Trynew
时间:
2003-3-7 23:51
ACCESS精品推荐栏里不少:
http://www.office-cn.net/bbs/list.asp?boardid=9
作者:
CJB_2001
时间:
2003-3-8 00:32
Private Sub REGIST_BTN_Click()
On Error GoTo Exit_REGIST
Dim dbs As Database, rst As Recordset
Set dbs = OpenDatabase(StrMasterDrv & "SPCMASTER.MDB")
Set rst = dbs.OpenRecordset("HIN_1")
Me!ITEM_CODE_BOX.SetFocus
rst.Index = "INDEX_2"
rst.Seek "=", Me!ItemHeadBox
Beep
If rst.NoMatch Then
If MsgBox("登録" & Me!ITEM_CODE_BOX & "?", vbQuestion + vbYesNo, "登録品目CODE") = vbYes Then
rst.AddNew
rst!H_CODE = Me!ItemHeadBox
rst!BUNRUI = Me!CHR_CMB
rst.Update
Me!LIST.Requery
End If
Else
MsgBox " " & Me!ITEM_CODE_BOX & " <- 已經登録 "
End If
rst.Close
dbs.Close
ClearData
Set dbs = Nothing
Set rst = Nothing
Exit_REGIST:
Err.Clear
Exit Sub
Err_No:
If Err.Number <> 2427 Then
MsgBox Err.Description
End If
Resume Exit_REGIST
End Sub
看看
作者:
CJB_2001
时间:
2003-3-8 00:33
Private Sub REGIST_BTN_Click()
On Error GoTo Exit_REGIST
Dim dbs As Database, rst As Recordset
Set dbs = OpenDatabase(StrMasterDrv & "SPCMASTER.MDB")
Set rst = dbs.OpenRecordset("HIN_1")
Me!ITEM_CODE_BOX.SetFocus
rst.Index = "INDEX_2"
rst.Seek "=", Me!ItemHeadBox
Beep
If rst.NoMatch Then
If MsgBox("登録" & Me!ITEM_CODE_BOX & "?", vbQuestion + vbYesNo, "登録品目CODE") = vbYes Then
rst.AddNew
rst!H_CODE = Me!ItemHeadBox
rst!BUNRUI = Me!CHR_CMB
rst.Update
Me!LIST.Requery
End If
Else
MsgBox " " & Me!ITEM_CODE_BOX & " <- 已經登録 "
End If
rst.Close
dbs.Close
ClearData
Set dbs = Nothing
Set rst = Nothing
Exit_REGIST:
Err.Clear
Exit Sub
Err_No:
If Err.Number <> 2427 Then
MsgBox Err.Description
End If
Resume Exit_REGIST
End Sub
看看
作者:
access001
时间:
2003-3-8 05:09
非常感谢CJB_2001和Trynew 版主的回复,向开放源码的大大们致敬!!!
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/)
Powered by Discuz! X3.3