473,508 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access 2007 Preventing Form Updates

1 New Member
I am changing the FILTER, ORDERBY, and ORDERBYON attributes of an Access 2007 form. I have code tied to buttons on the form that resort and/or refilter the records of a datasource based on user selections.

When the form is closed, I am trying to wipe out any parameters that have been set in these attributes in order to try and put the form back in its original state, when these attributes were empty. See code I'm using below:

================================================== =======
Private Sub Form_Close()
On Error GoTo Err_Form_Close
'prevent unintentional form updates
Me.Filter = vbNullString
Me.OrderBy = vbNullString
Me.OrderByOn = False
DoCmd.Close acForm, Me.FormName, acSaveYes
Exit_Err_Form_Close:
Exit Sub

Err_Form_Close:
If (Err = 2501) Then
Resume Next
End If
MsgBox Err.Description
Resume Exit_Err_Form_Close
End Sub
================================================== =======

I have played with the "docmd". In the current code, I try to wipe out the values and save the form. I have also tried using ACSAVENO, with the thinking being that if I answered no, Access would not keep any of my changes. It doesn't seem to matter, because when I close the form and reopen in Design View, the last set of values from the form are in the ORDERBY and FILTER attributes.

I just added the err logic, in the hopes of making this work. But I thought I would see if someone could help while I try to figure this out. Any help would be GREATLY appreciated.
Jan 31 '08 #1
1 1800
sierra7
446 Recognized Expert Contributor
Hi
I see your query has been around for 5 days and nobody has had a go!

I know what you mean about opening a form in design mode and seeing a filter or order-by string in the properties. This only seems to happen when you switch to Design mode from an open form. The last criteria seem to 'stick'.

I have not succeeded in removing them programmatically on the On_Close event. If you remove them manually (in design mode) then always close the form before opening in Design mode, they seem to remain clear.

However, even when they are not cleared they do not seem to have an effect on the form when Opened. Are they causing a problem ?

S7
Feb 5 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
2305
by: CJM | last post by:
How do people go about preventing the user from submitting a form for a 2nd time? For example, the user submits a form, clicks on the back button, and the submits the form again. I have used...
5
2720
by: elieli_132 | last post by:
Hi, My problem is the following: Made changes to code in form and closed the form. Now unable to open / design the form. - Tried copying and pasting - the new one does not open /display....
2
2549
by: rdemyan via AccessMonster.com | last post by:
I have a custom message form that I want to display when the user shuts down my app. Some clean up needs to be done during shutdown and I want to display this form and then display various...
2
6254
by: Wayne | last post by:
I've been having a click around Access 2007 this afternoon and have discovered some things that range from annoying to alarming. My Access 2003 menu bars, which I, like many others, use...
17
7646
by: Neil | last post by:
A client of mine likes some of the new bells and whistles in Access 2007, and is thinking about converting our A03 format MDB to an A07 format file. However, while some of the users have A07, many...
0
4086
by: Cindy Huyser | last post by:
I have an Access 2000 database behind a threaded Java application that that can have have concurrent access to the same table (but not the same record). The database is set up for shared access...
5
4148
by: lgeastwood | last post by:
I have a weird problem in Access 2007. I've been working in A07 for about 2 weeks when this thing began occurring. I'm working in the VB Code Editor and set break points for event procedures....
0
1277
by: ARC | last post by:
The new tabbed interface in access 2007, has led to one interesting problem. With a report shown in preview mode, and maximized, it just becomes a new tab. The user can click back over to the form,...
5
3639
by: David Wright | last post by:
Hello All I am using Microsoft Access 2003. I have an input form (Single Form) into which the clerk records appliance details. Some appliance details will never change, for instance the 'Make...
0
7129
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5637
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.