• Crash! (A2KSR1)

    Author
    Topic
    #362174

    I have a very simple form containing a subform and a sub-subform. Every time, regardless of what computer I am working from (Win98 or WINME), when I search for certain names (combo box to search for customerID), the whole of Access shuts down with the following error:

    Win32 Kernel core component attempted to use a null data pointer variable.
    Access has caused an invalid memory … in kernel32

    Module Name: KERNEL32.DLL
    Description: Win32 Kernel core component
    Version: 4.10.2222
    Product: Microsoft® Windows® Operating System
    Manufacturer: Microsoft Corporation

    Application Name: Msaccess.exe
    Description: Microsoft Access for Windows
    Version: 9.0.3822
    Product: Microsoft

    Viewing 0 reply threads
    Author
    Replies
    • #549373

      You could have a corrupted form (or subform or sub subform), so first try a compact.

      It looks like you may be dealing with a null value in a field that shouldn’t have one–probably in a join field. Try taking off the subsubform first and see if you get the error without it. If you do, try taking off the subform. If your form works without one or both of the subforms, you’ve isolated your problem. Look at the data the main form uses and see if there are any nulls in fields you used to link the parent and child forms.

      • #549551

        I have checked all tables for null values in linked fields. None. I deleted the subsubform (orderdetails). The form worked. I tried to add a new subform but despite linking the fields and double checking, could not get it to work. Tried to reconstruct the form from scratch with the wizard but says it cannot construct form. I tried creating all new form with new tables (no data) and it will not do. i.e. one subform it will do, two it will not. I have run compact and repair. no change. Any ideas?

        • #549578

          It sounds like there’s something wrong with the way you’re trying to link the sub subform or with your Access installation. I’ve used these quite a bit in Access 2000 without any problems. In fact, A2k is the first version you can nest even deeper and I’ve successfully nested them deeper than sub subform.
          [indent]


          Tried to reconstruct the form from scratch with the wizard but says it cannot construct form


          [/indent]This gives me pause. You mean you tried to build a new form and the wizard says it can’t do it, or it can’t build the subform? At what point do you get that message? I doubt that the wizard will create sub subforms, although that’s guesswork since I don’t use it at all. However, this sounds more and more like there’s something wrong with the way you’re linking the subform and sub subform. Can you explain how you’re doing that?

          • #549667

            I too have used this form setup in other databases without a problem. I’m quite confident the links are fine (relationships and syntax). Remember, I did build the form at the birth of the application and it worked fine. I have partially solved this riddle but first I will explain further I could not replace subforms on this form nor build a NEW form with subforms either manually or with a wizard. The wizard would go through the whole process but refuse to build any part of the form after clicking the “Finish” button. If I start a brand new database, I CAN construct the form, subform and subsubform, UNLESS I import the tables (even without data). Then I get wizard error again, etc. The only things I have done that I can think of is add a couple of modules and add data. Removing the following module seems to help. But why I don’t know. Can you see anything in it that would cause this instability? I am now able to reconstruct the form but it will still crash on certain customers.

            Public Function RemoveCharacter(strRemovalCharacter As String, strTableName As String, strFieldName As String)
            ‘===============================================================’
            ‘ Author: Jayden MacRae ‘
            ‘ Created: 27/10/2001 ‘
            ‘ Purpose: To remove any characters from a field in a table ‘
            ‘===============================================================’
            Dim rstPerson As Recordset
            Dim intHyphenPos As Integer
            Dim strFieldValue As String

            Set rstPerson = CurrentDb.OpenRecordset(strTableName, dbOpenTable)
            With rstPerson
            Do Until .EOF
            Do
            strFieldValue = Nz(.Fields(strFieldName))
            intHyphenPos = InStr(1, strFieldValue, strRemovalCharacter)
            If intHyphenPos > 0 Then
            strFieldValue = Left(strFieldValue, intHyphenPos – 1) & _
            Right(strFieldValue, Len(strFieldValue) – intHyphenPos)
            End If
            If strFieldValue .Fields(strFieldName) Then
            .Edit
            .Fields(strFieldName) = strFieldValue
            .Update
            End If
            Loop Until intHyphenPos = 0
            .MoveNext
            Loop
            .Close
            End With

            Set rstPerson = Nothing
            End Function

            • #549764

              I never use the dbOpenTable parameter, so I can’t tell whether that has any effect or not, but you might try dbOpenDynaset instead and see whether it makes a difference.

              Here’s how I would modify it. Taking the CurrentDb out of the OpenRecordset statement may be all that really needs changing, but unless you’re trying to maintain backward compatibility with Access 97, you’re doing some things the hard way. I used the built-in replace function here:

              Dim dbs As DAO.Database
              Dim rstPerson As DAO.Recordset
              Dim fld As DAO.Field
              Dim strFieldValue As String

              Set rstPerson = dbs.OpenRecordset(strTableName, dbOpenDynaset)
              With rstPerson
              Do Until .EOF

              Set fld = .Fields(strFieldName)
              strFieldValue = Nz(nz(fld,vbNullString))
              If InStr(strFieldValue, strRemovalCharacter) >0 Then
              strFieldValue = Replace(strFieldValue,strRemovalCharacter,vbNullString)

              If strFieldValue fld.Value Then
              .Edit
              .Fields(strFieldName) = strFieldValue
              .Update
              End If

              .MoveNext
              Loop
              .Close
              End With

              Set fld = Nothing
              Set rstPerson = Nothing
              Set dbs = Nothing

    Viewing 0 reply threads
    Reply To: Crash! (A2KSR1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: