標題:
[分享]
表單的if..else示例
[打印本頁]
作者:
neilgboy
時間:
6 小時前
標題:
表單的if..else示例
Private Sub Form_AfterUpdate()
If IsNull(LOT) = False Then
Dim cn As New ADODB.Connection
Dim rss As New ADODB.Recordset
Set cn = CurrentProject.Connection
rss.Open "PRO_MOC_LOG_INSERT '" + RTrim(LOT) + "'", cn
'RSS.Open "PRO_MOC_LOG_INSERT '" + RTrim(LOT) + "','" + LEFT(RTrim(Text1), 13) + "'", CN
'CNN.Execute "PRO_INV_DETAIL '" & RTrim(Text0) & "', '" & RTrim(Text2) & "' "
If rss.Fields(0) = "1" Then
Beep
MsgBox "森LOT祥湔婓", vbOKOnly, "劑豢"
Me.Requery
DoCmd.GoToRecord , , acNewRec
ElseIf rss.Fields(0) = "2" Then
Beep
MsgBox "森LOT腔?鷂庨鍔祥睫", vbOKOnly, "劑豢"
Me.Requery
DoCmd.GoToRecord , , acNewRec
ElseIf rss.Fields(0) = "4" Then
Beep
MsgBox "森LOT腔庨鍔鷂芃庨鍔祥睫", vbOKOnly, "劑豢"
Me.Requery
DoCmd.GoToRecord , , acNewRec
ElseIf rss.Fields(0) = "3" Then
Beep
MsgBox "RL笭葡芃", vbOKOnly, "劑豢"
Me.Requery
DoCmd.GoToRecord , , acNewRec
Else
Me.Requery
DoCmd.GoToRecord , , acNewRec
End If
rss.Close
cn.Close
Set rss = Nothing
Set cn = Nothing
End If
End Sub
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)