Private Sub Command12_Click()
Dim stDocName As String
If user <> User1 Then
MsgBox "ª×èÍ·Õè¾ÔÁ¾ìäÁèÁÕÍÂÙè㹺ѪռÙéà¢éÒÃкº§Ò¹¹Õé", vbDefaultButton1, "¤Óá¹Ð¹Ó"
user.SetFocus
End If
If pass <> pass1 Then
MsgBox "ÃËÑʼèÒ¹¢Í§¤Ø³äÁè¶Ù¡µéͧ ¡ÃسҵԴµèͼÙé´ÙáÅÃкº", vbDefaultButton1, "¤Óá¹Ð¹Ó"
pass.SetFocus
End If
If Dep <> 7 Then
MsgBox "¤Ø³äÁèÁÕÊÔ·¸Ôìà¢éÒâ»Ãá¡ÃÁ§Ò¹ËéͧÊӹǹ", vbDefaultButton1, "¤Óá¹Ð¹Ó"
Command11.Visible = True
Command11.SetFocus
Command12.Visible = False
Else
DoCmd.OpenForm "FormroomdumInA"
Forms!FormroomdumInA!Name2 = Me!Name1
Forms!FormroomdumInA!ro = Me!Dep
Dep.SetFocus
DoCmd.Close acForm, "FormroomdumIn", acSaveNo
End If
End Sub
---------------------------------------------------
Private Sub Command12_Click()
Dim stDocName As String
If user <> User1 Then
MsgBox "ª×èÍ·Õè¾ÔÁ¾ìäÁèÁÕÍÂÙè㹺ѪռÙéà¢éÒÃкº§Ò¹¹Õé", vbDefaultButton1, "¤Óá¹Ð¹Ó"
user.SetFocus
End If
If pass <> pass1 Then
MsgBox "ÃËÑʼèÒ¹¢Í§¤Ø³äÁè¶Ù¡µéͧ ¡ÃسҵԴµèͼÙé´ÙáÅÃкº", vbDefaultButton1, "¤Óá¹Ð¹Ó"
pass.SetFocus
End If
If user <> User1 Then
MsgBox "¤Ø³äÁèÁÕÊÔ·¸Ôìà¢éÒâ»Ãá¡ÃÁÊè§Êӹǹ", vbDefaultButton1, "¤Óá¹Ð¹Ó"
Command11.Visible = True
Command11.SetFocus
Command12.Visible = False
Else
stDocName = "FormroomdumInD"
DoCmd.OpenForm stDocName
Forms!FormroomdumInD!Name2 = Me!Name1
DoCmd.Close acForm, "FormroomdumInC", acSaveNo
End If
End Sub