Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    ayatsweid is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    18
    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!!

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Okay, check this out. It is about as non-click friendly as I can get it.

    EDIT: Purpose served, file removed.
    Last edited by June7; 11-10-2011 at 11:47 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #18
    ayatsweid is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    18
    Thank you for creating that June7,
    I would still like to stick with my scanning only because I've gotten so close and am just missing ONE more thing. My code now allows the user to scan the chart, then if checking out the chart, scan the employee ID. Then it will set focus back to the searchID field. Then if my user is checking a chart back in, all they have to do is scan it (and not the employee's ID), then it will delete the EmployeeID field and show my Msgbox that "Chart checked in to TB Medical Records". But I want it to set focus back to the SearchID field and I'm trying the below code but it's now working - any ideas?

    Private Sub Employee_ID_AfterUpdate()
    MsgBox "Chart Checked Out"
    End Sub
    Private Sub Form_AfterInsert()
    Me.txtSearchID.SetFocus
    End Sub
    Private Sub Form_Open(Cancel As Integer)
    Me.txtSearchID.SetFocus
    End Sub
    Private Sub txtDateOut_Change()
    Me.txtSearchID.SetFocus
    End Sub
    Private Sub txtDateOut_GotFocus()
    Me.txtDateOut = Now()
    Me.txtSearchID.SetFocus
    End Sub
    Private 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

    If IsNull(Me.Employee_ID) Then
    Me.txtDateOut = Now()
    End If

    Me.Employee_ID.SetFocus
    End Sub

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Exactly why is it not working, what happens - error message, nothing, wrong results?

    I thought my version would be scan only?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #20
    ayatsweid is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    18
    June7,
    You know what, I misunderstood your database. The wording for the "if you want to check out chart, scan employee ID now, else press Enter" confused me. You're right! It does what I need it to do. However, the file type is in Access 2010 so I can't open it on my work computer which only has Access 2007 (I originally opened it on my laptop in 2010). Is there a way you can make it Access 2007?

    Thank you!!

  6. #21
    ayatsweid is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    18
    June7,
    Nevermind - I fixed the compatibility issue!
    Now I just need 1 more thing!
    I need a msgboxes to confirm that the chart was checked in or out. I was able to get the msgbox for checking out the chart but my msgbox for checking the chart back in doesn't work. can you help??? We're almost there!!!

    Private Sub txtSearchID_AfterUpdate()
    With Me
    .RecordsetClone.FindFirst "[ID]=" & .txtSearchID
    If .RecordsetClone.NoMatch Then
    If IsNull(Me.txtEmpID) Then
    MsgBox "This is a new chart. Must scan employee ID then rescan chart."
    .txtSearchID = Null
    .txtEmpID.SetFocus
    Else
    DoCmd.GoToRecord , , acNewRec
    .ID = .txtSearchID
    .Employee_ID = .txtEmpID
    DoCmd.RunCommand acCmdSaveRecord
    MsgBox "Chart has been checked in."
    .Refresh

    End If
    Else
    .Recordset.Bookmark = .RecordsetClone.Bookmark
    If IsNull(.Employee_ID) And IsNull(.txtEmpID) Then
    MsgBox "You are checking out a chart. Must scan employee ID then rescan chart."
    .txtSearchID = Null

    Else
    .Employee_ID = Null
    .txtDateOut = Null
    If Not IsNull(.txtEmpID) Then
    .txtDateOut = Now()
    .Employee_ID = .txtEmpID
    .txtEmpID = Null
    MsgBox "Chart has been checked out."
    End If
    End If
    End If
    .txtSearchID = Null
    DoCmd.RunCommand acCmdSaveRecord
    End With
    End Sub

  7. #22
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Never was requirement to click to switch between txtEmpID and txtSearchID, just press Enter key or Tab key and TabOrder will cycle between the two controls.

    Here is my latest offer. It handles new employees.

    It has project property settings to restrict users from the design features. Hold down shift key as project opens to override and enable design editing.

    EDIT: Purpose served, file removed.
    Last edited by June7; 03-22-2012 at 04:24 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #23
    ayatsweid is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    18
    June7,
    THANK YOU SO MUCH! My database is complete and working! I will begin having my staff use it probably this week and I'm crossing my fingers that nothing unexpected will happen.
    Thanks again so very much - I really appreciate it!!

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 09-12-2011, 10:22 AM
  2. Counting only 'checked' Yes/No fields on a
    By pwdpwd in forum Programming
    Replies: 9
    Last Post: 04-14-2011, 09:28 AM
  3. Check/Uncheck Checkbox on "Enter" click
    By emilyrogers in forum Forms
    Replies: 2
    Last Post: 02-17-2011, 10:24 AM
  4. Replies: 6
    Last Post: 01-31-2011, 03:31 PM
  5. Simple query to show when items are not checked?
    By mrwistles in forum Queries
    Replies: 28
    Last Post: 09-02-2010, 02:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums