View Single Post
  #1 (permalink)  
Old April 7th, 2008, 07:54 AM
jeremy1048 jeremy1048 is offline
Authorized User
Join Date: May 2007
Location: , , .
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Default new record function getting locked in place

Hi folks,

I must have rebuilt this particular access 2000 database a dozen times now. For some reason I cannot fathom, the new record counter is regularly getting locked as on when the open form with link criteria is used.

The form has worked fine in the past and for weeks on end and then suddenly this crops up again.

This is the code that is currently there behind the open record button:

Private Sub btnopeninspect_Click()

    On Error GoTo errorhandler

    gstrcallingform = Me.Name
    btnclick = True

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmfileinspect"

    stLinkCriteria = "[inspectid]=" & Me![txtinspectid]
    DoCmd.openform stDocName, , , stLinkCriteria

    Exit Sub

    generalerrorhandler Err.Number, Err.Description, fsmor, "btnopeninspect_click"
    Resume exitop

End Sub

As you can see nothing special. However when a break is put in and the path followed, for the checks for new record in form_load, it displays new record value is -1 and therefore follows through the rest of the path correctly.

My question is how the heck is this happening and how the heck do I stop it.

Reply With Quote