HI June7!
If the EmployeeID field is null automatically every time a chart is scanned, then when they do want to scan the employeeID - they will have to click on the EmployeeID field.
If we made the cursor go to the EmployeeID automatically after the chart was scanned, then the user would have to click on the txtSearchID box again to scan in the next chart.
It's true that we don't have anything to help if an Employee forgets to scan the chart or their ID but we will have to deal with that on a case by case basis. It is in the interest of the employees to make sure they scan their charts because when they need one, they have to go to everyone in the clinic searching, which takes a lot of time.
That's why I want to make this process with no clicks - so it is easy enough to induce the employees to use it.
I had my code wrong: I didn't mean to say, IfNull then empty string in EmployeeID. I want to say if not null, then empty string in employeeID.
But if null, then set cursor to employeeID field to allow user to scan in an employee id.
I got it to work though with the below code:
rivate Sub txtSearchID_AfterUpdate()
If (txtSearchID & vbNullString) = vbNullString Then Exit Sub
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "[ID]=" & txtSearchID
If rs.NoMatch Then
DoCmd.GoToRecord , , acNewRec
ID = Me.txtSearchID
DoCmd.RunCommand acCmdSaveRecord
Me.Refresh
Else
Me.Recordset.Bookmark = rs.Bookmark
End If
rs.Close
txtGoTo = Null
If Not IsNull(Me.Employee_ID) Then
Employee_ID.Value = ""
MsgBox "Chart checked in to TB Medical Records."
End If
Me.Employee_ID.SetFocus
End Sub
But now my Date/Time field called DateOut does not update when the record is changed. It maintains the date and time the record was created only. I tried Me.Refresh in the After Update event of EmployeeID but that doesn't work.
Can you help me with that?
thanks!!