Switchboard Me.FilterOn not working in 2007 Full Version

G

Gordon Clark

Thanks for your time, first off!

Situation is this: A 2002 database in place for years with a stock
Switchboard - no tweaks, nothing out of the ordinary. Compiled FE works fine
for 2002 runtime and full version.

A User moved to 2007 and the client is not filtering as expected. When User
loads into the uncompiled FE they are able to click "Toggle Filter" on the
ribbon and the SW works fine. (Of course, the TF button is unavailable in the
compiled FE - and this should not be necessary anyway.)

Obligatory code insert:
Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.

' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True
DoCmd.Maximize

End Sub

I've read of hiccups with VBA toggling - but would expect Microsoft's code
to work in a MS application - which leads me to believe there may be
something above the Form level that I've done that is disabling normal
operation. (The DB opens to the Switchboard, and the Navi bar or database
window are not shown - yet it won't move past the first SW.)

Thoughts?
 
A

Allen Browne

Forms have a new FilterOnLoad property in Access 2007. Try:

a) Ensure FilterOnLoad is set to No. (Also OrderByOnLoad.)

b) Move the code into Form_Load.

c) Double check that the expression is valid (e.g. add brackets around the 2
parts, and double-check the Argument field is Text (not Number) in table
design.

d) Do the Maximize before the filter.

e) Debug.Print to verify that it's running.

f) Look for anything else that could be interfering, e.g. in the form's
Activate or Current event, or the events of the first control to get focus.
 
G

Gordon Clark

Allen - Thank you for your advice.
(Caveat: The FilterOnLoad and OrderByOnLoad setting could not be set as
described as we have only one user currently on 2k7 - and could not add a
permanent reference to the Access 2007 library as it does not exist for 150+
other users.)

Now - to the fix... Did all other items you recommended and ended up with
this code:
Private Sub Form_Load()
Me.RecordSource = _
"SELECT [Switchboard Items].SwitchboardID, " & _
"[Switchboard Items].ItemNumber, [Switchboard Items].ItemText, " & _
"[Switchboard Items].Command, [Switchboard Items].Argument FROM [Switchboard
Items];"

'The following moved from Form_Open per recommendation of Allen Browne,
Microsoft Access MVP
'ref:
http://www.microsoft.com/office/com...cess&mid=a6625e50-0fd9-41fb-a00b-c560f9f25247
' Move to the switchboard page that is marked as the default.
DoCmd.Maximize 'moved from after the Me.FilterOn = True statement below
- Maximize, *then* Filter
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True

End Sub

That has tested out and is working for this user. Thank You Mr. Browne!
Gordon Clark

Allen Browne said:
Forms have a new FilterOnLoad property in Access 2007. Try:

a) Ensure FilterOnLoad is set to No. (Also OrderByOnLoad.)

b) Move the code into Form_Load.

c) Double check that the expression is valid (e.g. add brackets around the 2
parts, and double-check the Argument field is Text (not Number) in table
design.

d) Do the Maximize before the filter.

e) Debug.Print to verify that it's running.

f) Look for anything else that could be interfering, e.g. in the form's
Activate or Current event, or the events of the first control to get focus.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


Gordon Clark said:
Thanks for your time, first off!

Situation is this: A 2002 database in place for years with a stock
Switchboard - no tweaks, nothing out of the ordinary. Compiled FE works
fine
for 2002 runtime and full version.

A User moved to 2007 and the client is not filtering as expected. When
User
loads into the uncompiled FE they are able to click "Toggle Filter" on the
ribbon and the SW works fine. (Of course, the TF button is unavailable in
the
compiled FE - and this should not be necessary anyway.)

Obligatory code insert:
Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.

' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True
DoCmd.Maximize

End Sub

I've read of hiccups with VBA toggling - but would expect Microsoft's code
to work in a MS application - which leads me to believe there may be
something above the Form level that I've done that is disabling normal
operation. (The DB opens to the Switchboard, and the Navi bar or database
window are not shown - yet it won't move past the first SW.)

Thoughts?

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top