Solved Form Properties "Order By" and "Filter By" retains parameters.

raziel3

Registered User.
Local time
Today, 18:21
Joined
Oct 5, 2017
Messages
315
Not sure I phrased the question properly.

I have a form that opens and goes to new record. Data Entry property is set to No.

Everything works great for the past couple of months but now I get a Runtime Error (see attachment).

Clicking on End opens up the form but I am unable to add records.

I've drill down the culprit to a parameter in the Order By property of the form. When I remove it, the form works as it should.

The question, and I have noticed this with the Filter By property also, why does closing off the database and/or the form retains the parameters in these properties?
 

Attachments

  • Runtime Error 2105.jpg
    Runtime Error 2105.jpg
    204 KB · Views: 159
  • Order By Parameter.jpg
    Order By Parameter.jpg
    502.7 KB · Views: 169
the form retains the parameters in these properties
First set form properties FilterOnLoad and OrderByOnLoad to = False
Try code for OnClose Event:
Code:
Private Sub Form_Close() 'OnClose Event
    Me.Filter = ""
    Me.FilterOnLoad = False
    Me.OrderBy = ""
    Me.OrderByOnLoad = False
End Sub
 
why does closing off the database and/or the form retains the parameters in these properties?

I'm going to offer an answer to that question (maybe). The form's "Filter" and "OrderBy" properties are form properties that would be saved if you altered the form and clicked the Save button (in the Access form design page) while those changes were in effect. OR if you had code in some action taken by the form that could be interpreted as saving the form, not just the data therein.
 
The form's "Filter" and "OrderBy" properties are form properties that would be saved if you altered the form and clicked the Save button (in the Access form design page) while those changes were in effect
You are right @The_Doc_Man. This was the problem.
 

Users who are viewing this thread

Back
Top Bottom