Open form in EDIT mode (Access 2003) (1 Viewer)

Flintstone

New member
Local time
Today, 08:53
Joined
Sep 22, 2008
Messages
3
Greetings:

I've been working on an Access project for a few months; all was going swimingly until a few days ago when I was no longer able to open a form in edit mode; it appears to only be opening in ADD mode.

I get to the form via the switchboard, where it is set to open in EDIT MODE. (If I just click on the form, it does the same thing).

The behaviour I get is, when the (multi-line) form is opened, a single line/instance shows up. (And the record count at the bottom is 1 of 1.)

To see all the data, I have to click on the filter/funnel twice - once applies the filter (a very broad date range) setup in the form properties page (showing 1 of xxx (filtered)) - twice gives me all the data. I even went so far to add the following code to the Form_Load event, to no avail.

Private Sub Form_Load()
Dim frm As Form
Set frm = Me.Form
frm.FilterOn = False
End Sub

Has anyone else experienced this, and possibly have a solution? Other forms in the project don't have this problem!
Thanks.
 

boblarson

Smeghead
Local time
Today, 08:53
Joined
Jan 12, 2001
Messages
32,059
Sounds like a persistent filter problem.

Try this in your form's Load Event:

Code:
Private Sub Form_Load()
   Me.Filter = ""
   Me.FilterOn = False
End Sub
 

Flintstone

New member
Local time
Today, 08:53
Joined
Sep 22, 2008
Messages
3
A fine suggestion, but all it does is make the filter button inaccessible! (and thus, unable to remove whatever is filtering!)

Thanks.
 

boblarson

Smeghead
Local time
Today, 08:53
Joined
Jan 12, 2001
Messages
32,059
You need to open your form in design view and go to the Filter property in the properties dialog, remove anything there and save your form. Then, you should make sure you have not used any code anywhere that uses the acSaveYes in any code as that will close the form as that has nothing to do with the records, but design changes of which the filter is also one.
 
Local time
Today, 10:53
Joined
Mar 4, 2008
Messages
3,856
If Bob's last suggestion doesn't work (since I'm guessing his first suggestion didn't), you could have some rogue code setting the filter. Look through all the VB for that form and any subforms and see if the filter is set. Or just do a search through your entire VB project for the string ".filter".
 

aqif

Registered User.
Local time
Today, 16:53
Joined
Jul 9, 2001
Messages
158
How about adding an extra line on Form Load event

DoCmd.ShowAllRecords

Just a suggestion, worth a shot
 

Flintstone

New member
Local time
Today, 08:53
Joined
Sep 22, 2008
Messages
3
auif:

That is the closest thing to working!
In other words...now I see all the records.
The down side is...I see all the records :) even when opening up the form in "Add" mode.

Does anyone know the mechanism for opening a form in add vs update mode, and is there a way to figure out which one is occurring during form load time (so I can trigger this docmd?)

I am surmizing that the issue here is that the form is not opening correctly from the switchboard (in edit mode) -- although why that would suddenly start is beyond me!

Thanks everybody for your suggestions.
 

boblarson

Smeghead
Local time
Today, 08:53
Joined
Jan 12, 2001
Messages
32,059
I am surmizing that the issue here is that the form is not opening correctly from the switchboard (in edit mode)
MY suggestion is to get away from using the limited switchboard (I hate the thing and try to never use it if at all possible). I create my own custom forms and then I have all of the control I want.
 

AccessHappy

New member
Local time
Today, 16:53
Joined
Jul 7, 2009
Messages
2
Hi. I just found this thread as I encountered the same problem with Access 2007. The solution for me was to that the "DataEntry" property of the form had been set to true (probably due to me saving the form after opening it in 'add mode' from the switchboard). Good design procedure is to never switch to design mode after opening the form in runtime mode (ie. form view), but even after years of programming and Access design I still make the same mistake occasionally. It's just too tempting to flick to design mode to make a small code/property tweak, rather than the proper procedure of shutting the form then re-opening in design mode. I now have the form opening properly in either add or edit mode from the switchboard. I respect the previous poster's view on switchboards, but I'm creating databases for non-programmers to maintain after the end of my contract. Hope this may help someone further down the road.
 

Users who are viewing this thread

Top Bottom