Results 1 to 14 of 14
  1. #1
    Join Date
    Oct 2007
    Location
    Harrisburg, PA
    Posts
    44

    Angry Unanswered: #Deleted Message

    Good morning,

    I am trying to get a time clock application to work on two computers at the same time. Most of the time, one computer will be used for punching in and the other will be for punching out. I have no problem having them punch in, but when they go to punch out on the other computer, it says "You can't go to the specified record." Then, all the fields on the form say "#Deleted".

    I have done my best to find answers on this but nothing seems to fit this problem or it does not work.

    Here are the details:
    -There is a table with the time clock records and then another table with the user's in/out status. These tables are on a networked drive and are linked to the front end user databases

    -The forms write to the networked tables (when punching in) and when they punch out, it is supposed to find the record and display the information, and then let you punch out.

    -This works fine when on only one computer

    If this description is too vague, I will post more to try and explain. At this point, any help would be great because I have ran out of patience for this problem.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    #deleted# means that the record is no lonnge available.. its been deleted by another user on a different computer, or another process on the same computer

    it sounds like there is a snafu in the way you are writing or updating records records. it could be in the way you use a primary key, oit could be the type of data.

    its not uncommon to see #deleted#, but if you are getting it frequently on a two user system then I'd check the physical design of the db or application
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    it is supposed to find the record and display the information, and then let you punch out.
    At a guess, the problem is in this area. You need to supply more information, such as the code that does this..... or is supposed to do this.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    Oct 2007
    Location
    Harrisburg, PA
    Posts
    44
    One thing I forgot to mention is that the forms are linked to the record table. Should I be using record sets or something?

    Right now I am using update, append and delete queries to add and delete info.

    I am not very good using record sets yet so I opted not to use them.

  5. #5
    Join Date
    Oct 2007
    Location
    Harrisburg, PA
    Posts
    44
    This is the code that runs once a user name is chosen from the drop down on the form.

    Private Sub Employee_AfterUpdate()

    'Define the variables
    Dim strUser As String
    Dim strStatus As String
    Dim strStatus2 As String

    'strUser is the value from a dropdown list of user names
    strUser = Me.Employee.Value

    'strStatus is the username (on the in/out status table) that goes with the user name from the dropdown (this is null if the user is not punched in yet)
    strStatus = DLookup("UserID", "tbl-UserLogIN/OUT", "UserID = '" & strUser & "'")

    'strStatus2 is the primary key value that goes with the user id from the in/out status table (this is null if the user is not punched in yet)
    strStatus2 = DLookup("EntryNumber", "tbl-UserLogIN/OUT", "UserID = '" & strUser & "'")

    'If statement that will either set up the punch out status or get you ready to punch in
    If strUser = strStatus Then
    Me.PunchOut_Button.Enabled = True
    Me.PunchOut_Button.SetFocus
    Me.PunchIn_Button.Enabled = False
    Me.Employee.Enabled = False
    DoCmd.FindRecord strStatus2, , False, , True
    Me.PunchOut_Button.SetFocus
    DoCmd.Save acForm, "Order Batch Punch In/Punch Out"
    Else
    Me.PunchIn_Button.Enabled = True
    Me.PunchOut_Button.Enabled = False
    End If

    End Sub

    -------------------------------

    This is the code that runs once the punch out button is clicked.


    Private Sub PunchOut_Button_Click()

    'Enters the punch out time in the record table
    Me.EndTime.Value = Time()
    Me.Employee.Enabled = True
    Me.Employee.SetFocus

    'Once warnings are off, a delete query runs that deletes any records in which there is not a punch in or out value.
    'Then, another delete query runs to delete the user from the in/out status table.

    DoCmd.SetWarnings False
    DoCmd.OpenQuery "qry-DeleteBlanks"
    DoCmd.OpenQuery "qry-PunchOut"
    DoCmd.SetWarnings True

    DoCmd.GoToRecord acDataForm, "Order Batch Punch In/Punch Out", acNewRec

    End Sub

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Awesomely wonderful of you to do all that colouring

    I'm not sure, but I think that your delete query is deleting the records that the form is currently looking at?

    There might be an issue with the code that's saving the form too...
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  7. #7
    Join Date
    Oct 2007
    Location
    Harrisburg, PA
    Posts
    44
    The delete queries might have something to do with it, but I for the life of me cannot piece it together.

    The one delete query finds any line that has a user name without clock in and clock out values, that way they are not confused with the current record. This is the delete query called "qry-DeleteBlanks".

    The other delete query, "qry-PunchOut", goes into the user login/logout table and removes the username and current autonumber primary key number (thus making them clocked out)

    I have tried moving some things around and it is only making things worse.It seems as if the second user (one who will be punching out) does not see the records that the first user entered. If I close out of access and go back in, it then recognized the record that needs punched out, but I cannot have this access database open and close all the time. It is meant to stay open.

    Do you want me to post the whole database?

  8. #8
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Sounds like you might just need to ReQuery the form's data before navigating to the record in the punchout procedure.

    Posting the database can't hurt and makes it really easy to see what's going on
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  9. #9
    Join Date
    Oct 2007
    Location
    Harrisburg, PA
    Posts
    44
    Here is the file. I made the tables local and deleted any info that tied to my company. To recreate what I have set up, just make a backend database with the tables in it, and then link to it with two copies of the database. Then try running it with signing in on one, and then punching out on the other. The user Andy is currently punch in.

    Thanks, let me know what you come up with!
    Attached Files Attached Files

  10. #10
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    You know what? I'm not sure there's gonna be an easy answer. The simple fact is that you are changing data on one computer that the other one is currently looking at and that's why you get #Deleted coming up.

    I would just scrap the logic of deleting a record to "punch out". I'd re-design it so that rather than putting data into a table and then removing it to determine log in and log out, just modify a record with an update query or VBA.

    I think one of the other guys has a good example somewhere about time-clocking... it might even be in the code bank

    Sorry I can't give you a quick and easy answer.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  11. #11
    Join Date
    Oct 2007
    Location
    Harrisburg, PA
    Posts
    44
    Thank you. I figured it would come to that. I started a copy of the same program but using that logic instead of my original design last night and made some progress. I will let you know how it turns out. Thank you!

  12. #12
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Excellent

    Sorry I couldn't give you a quick and easy answer.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  13. #13
    Join Date
    Oct 2007
    Location
    Harrisburg, PA
    Posts
    44

    Thumbs up

    I got my 2nd version up and running and it works great. I got rid of the in/out status table and now have a column in my records table that defaults a value of "ACTIVE". When a user punches out, it finds their last "ACTIVE" record and changes it to "OUT" (using an update query, good idea StarTrekker).

    I also have two calls for a re query so that each computer see the new info before it goes to edit it.

    Thanks for all your help and for fixing my broken logic.

    You must be a Vulcan.

  14. #14
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    You're most welcome

    Live long and prosper!
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •