Results 1 to 4 of 4
  1. #1
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Acc 2K Doing weird things (Acc 2K Jet4 SP5)

    I got lost in your currents, but the current event happens fairly often--when you first open a form, every time you move between records, every time you requery the form, every time you update a record, every time the form gets the focus, etc. Using recordsetclone navigation in the current event may be what's causing your weird behavior, since it's recursive in that it should trigger the current event again.
    Charlotte

  2. #2
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Wellington, New Zealand
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Acc 2K Doing weird things (Acc 2K Jet4 SP5)

    HI Charlotte,

    Thanks for the comments. I completely agree with you. I also apologise for it being hard to follow.

    I guess the 2 points that I make are

    1. Notce in the table of records that I presented the CurrentFinish string is written to the table two records in a row

    2. If the OnCurrent event was firing twice in a row, it would still have to run through the sections of the OnCurrent Event that write Current, Current2, Current3 to the table before it could write CurrentFinish. It doesn't perform the parts of the OnCurrent Event that it should prior to the 'CurrentFinish' stage.

    Cheers

    Jayden

  3. #3
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Wellington, New Zealand
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Acc 2K Doing weird things (Acc 2K Jet4 SP5)

    Hi

    This one has me stumped. To cut a long story short, I am having locking issues in an Access database that two users are using at the same time. I can't seem to find the reason that records are locking, there don't seem to be any places where they should be being locked. Investigating this problem led me to look at what is happening during the OnCurrent and BeforeUpdate events of the data entry form.

    The databases that users are using are distributed MDE files (with linked tables back to a central .mdb file).

    In order to try and figure out what is happening between the both of them, at various stages during the OnCurrent and BeforeUpdate routines, I write information to table to try and track where each user is at when the locking occurs.

    I've noticed however that Access is 'repeating' parts of code that are NOT part of a loop (without repeating the parts of code the preceed them. Here is some output from the table that I am writing to.

    Only one user (charlotteb) is logged into the database when this is happening.

    <table border=1><td>User</td><td>Position</td><td>TimeStamp</td><td>Order</td><td>CharlotteB</td><td>CurrentFinish</td><td>25/10/2001 17:02:21</td><td>31209</td><td>CharlotteB</td><td>CurrentFinish</td><td>25/10/2001 17:02:21</td><td>31208</td><td>CharlotteB</td><td>Current3</td><td>25/10/2001 17:02:21</td><td>31207</td><td>CharlotteB</td><td>Current2</td><td>25/10/2001 17:02:21</td><td>31206</td><td>CharlotteB</td><td>Current</td><td>25/10/2001 17:02:21</td><td>31205</td></table>This table is showing the output from a function in reverse order (ie. the most recent event at the top).
    Notice how the 'CurrentFinish' output follows itself twice (without the Current1, 2, 3 etc).
    Next I will paste the event subroutine that is writing to the table
    ----------------------------------------------------------------------------------------------------------
    <big>Private Sub Form_Current()</big>
    Dim tempRecBookmark As Long

    DebugLog "Current" 'Degugger for LockedRecords

    If IsNull(Me![cboProviderID]) Then
    bExistingRecord = False
    'Me![cboProviderID].Locked = False
    Else
    bExistingRecord = True
    'Me![cboProviderID].Locked = True
    End If

    DebugLog "Current2" 'Degugger for LockedRecords

    If IsNull(Me![cboDisallowedReason]) Then
    Me![txtPSDate].Visible = False
    Else
    Me![txtPSDate].Visible = True
    End If

    DebugLog "Current3" 'Degugger for LockedRecords

    ' this is for going back to the disallowed claim that you just entered
    ' in the beforeUpdate event of the form, assign the [claimID] to lngdisallowRecID
    If lngdisallowRecID <> 0 Then
    DebugLog "Current4" 'De###### for LockedRecords
    tempRecBookmark = lngdisallowRecID
    lngdisallowRecID = 0
    Me.RecordsetClone.FindFirst "[ClaimID] = " & tempRecBookmark
    Me.Bookmark = Me.RecordsetClone.Bookmark
    End If

    DebugLog "CurrentFinish" 'Degugger for LockedRecords
    End Sub
    -------------------------------------------------------------------------------------------------------

    At various points in the subroutine, you will notice that the subroutine calls a function 'DebugLog' and passes a string variable. This function writes one line (using DAO) to the table shown above.

    Note how it is theoretically impossible for the line 'CurrentFinish' to be written twice in a row.

    I have no answers for this - and I suspect that Access is doing something that it shouldn't be. Has anyone got any insight, or experienced something similar?

    Your help or opinions are much appreciated.

    Cheers

    Jayden
    Access 2000 SR-2
    Jet4 SP5

  4. #4
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Wellington, New Zealand
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Acc 2K Doing weird things (Acc 2K Jet4 SP5)

    Yay,

    Your comments got me thinking (especially about the Recordsetclone causing the Current Event to fire)...so I then found the problem / cause of my query, thanks. It is certainly the Recordsetclone that is causing Access to run the Current Event again, then return to the place where it left off (thereby giving the double 'CurrentFinish'). This may certainly explain some of the record locking issues.

    You've been a great help, thanks.

    PS: I would never have though that Access would 'nest' a Current Event within another Current Event so to speak....don't we learn something everyday!

    Cheers

    Jayden

Posting Permissions

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