I am at a loss in my code and need help identifying where I am going wrong. Basically, I am working between two forms (main and time clock). The employee puts their EmployeeID (Primary) in Text8 Text field on the main form which opens to the associated record in the time clock form. When the timeclock form opens, I want the Text8 field to go null and the timeclock form to still be on on the associated record. However, the timeclock record opens up blank. Below is the code which is not giving me the desired results.
Private Sub Timeclockbtn_Click()
DoCmd.OpenForm "TimeclockF", , , "EmployeeID=" & Text8 & " AND " & _
Me.Text8 = Null
End If
End Sub
Private Sub Timeclockbtn_Click()
DoCmd.OpenForm "TimeclockF", , , "EmployeeID=" & Text8 & " AND " & _
Me.Text8 = Null
End If
End Sub