Fatal Error as form RecordSource is set.

  • Error Description

    An Access 2002 front end adp database connected to MS SQL Server 2000 tables back end running on server under WinServer 2000 through Terminal Services.

    The Access form in question is unbound, it's RecordSource is set during the OnOpen event by setting the RecordSource to an SQL string.

    The Access form has a series of event buttons which are used to a sort the columns of data displayed.

    The data is sorted by re-writing the SQL string that the RecordSource is based on, in effect change the last line of the SQL string - the ORDER BY clause.

    There are 16 of these sorting buttons, that is 8 columns of data sorted A-Z and Z-A.

    Clicking these buttons results in re-writing the RecordSource SQL string (strSQL). At the point where the RecordSource is set as

    Me.RecordSource = strSQL

    Access goes through a fatal error crash.

    The crash is not linked to any button, it is not consistent with the order the buttons are clicked. It may occurr on the first button clicked or after several buttons are clicked.

    I have not been able to re-create this error in my development environment, running Windows XP, SQL Server 2000 and MS Access 2002. Nor do I get this error when I test on my development server, apparently identical to the live server in its setup.

    I have run the de-compile procedure on the Access container.

    I have created a new, empty, Access adp container and imported just the offending form, stripping out all other elements of code.

    I have created a new form and imported the objects from the offending form into this new container.

    None of these actions have cleared the problem.

    I have re-coded the form to be bound to a table, and now use the OrderBy and FilterBy properties of the form which are updated in VBA at runtime as the sorting buttons are clicked and this seems to have stopped the problem.

    But setting the RecordSource of a form at run time to an SQL string is pretty fundamental and in this case is not consistent.

    Any ideas as to what may be occurring?

  • It is likely that the form is corrupt.

    Have you recreated the form from scratch (since you imported some objects)?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply