S
Song
I have a cmdStart button in frmWorkshop. When click, it opens another form
frmSignIn
On load event of frmSignIn, I make frmWorkshop visible = false
Below is cmdSignIn on form frmSignIn. It seems the line
Forms!frmWorkshop.[WS]=1 always in the memory instead of update the record.
Me.Dirty=False does not help. I have to either close frmWorkshop, or run
other report be fore the update to show up. Where did I do wrong?
Private Sub cmdSignIn_Click()
Dim rst As DAO.Recordset
Set rst = Forms!frmWorkshop.RecordsetClone
If Me.intEN <> "" Then
rst.FindFirst "EN = " & Me.intEN
If rst.NoMatch Then
txtMsg = "Employee number not found!"
Else
Forms!frmWorkshop.Bookmark = rst.Bookmark
If Forms!frmWorkshop.[WS] = 1 Then
txtMsg = "You have already signed in " &
Forms!frmWorkshop.[Full_Name] & "!"
Else
Forms!frmWorkshop.[WS] = 1
Me.Dirty = False
txtMsg = "Welcome! " & Forms!frmWorkshop.[Full_Name] & "."
End If
Me.intEN = ""
cboLookUp = ""
End If
End If
intEN.SetFocus
rst.Close
End Sub
frmSignIn
On load event of frmSignIn, I make frmWorkshop visible = false
Below is cmdSignIn on form frmSignIn. It seems the line
Forms!frmWorkshop.[WS]=1 always in the memory instead of update the record.
Me.Dirty=False does not help. I have to either close frmWorkshop, or run
other report be fore the update to show up. Where did I do wrong?
Private Sub cmdSignIn_Click()
Dim rst As DAO.Recordset
Set rst = Forms!frmWorkshop.RecordsetClone
If Me.intEN <> "" Then
rst.FindFirst "EN = " & Me.intEN
If rst.NoMatch Then
txtMsg = "Employee number not found!"
Else
Forms!frmWorkshop.Bookmark = rst.Bookmark
If Forms!frmWorkshop.[WS] = 1 Then
txtMsg = "You have already signed in " &
Forms!frmWorkshop.[Full_Name] & "!"
Else
Forms!frmWorkshop.[WS] = 1
Me.Dirty = False
txtMsg = "Welcome! " & Forms!frmWorkshop.[Full_Name] & "."
End If
Me.intEN = ""
cboLookUp = ""
End If
End If
intEN.SetFocus
rst.Close
End Sub