A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Filter and Search button not work in Access 2007



 
 
Thread Tools Display Modes
  #1  
Old April 16th, 2010, 08:04 PM posted to microsoft.public.access
Smitee2006
external usenet poster
 
Posts: 6
Default Filter and Search button not work in Access 2007

I have a form view where users can see a listing of all clients in datasheet
view. On this same form is a button that users can push to be prompted for a
client name or a portion of a client's name in order to search the listing
and have it filter down the results. Hitting the button and leaving the
prompt blank will return the full client listing again. This button no
longer works now that I am working in Access 2007. Anybody have any ideas
why this might be? I've included the button's
underlying code for information.

Private Sub FilterClient_Click()
On Error GoTo Err_FilterClient_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70

Exit_FilterClient_Click:
Exit Sub

Err_FilterClient_Click:
MsgBox Err.Description
Resume Exit_FilterClient_Click

End Sub

Thanks in advance for assistance.
  #2  
Old April 16th, 2010, 08:41 PM posted to microsoft.public.access
张小建
external usenet poster
 
Posts: 3
Default Filter and Search button not work in Access 2007



"Smitee2006" 写入消息
...
I have a form view where users can see a listing of all clients in
datasheet
view. On this same form is a button that users can push to be prompted
for a
client name or a portion of a client's name in order to search the listing
and have it filter down the results. Hitting the button and leaving the
prompt blank will return the full client listing again. This button no
longer works now that I am working in Access 2007. Anybody have any ideas
why this might be? I've included the button's
underlying code for information.

Private Sub FilterClient_Click()
On Error GoTo Err_FilterClient_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70

Exit_FilterClient_Click:
Exit Sub

Err_FilterClient_Click:
MsgBox Err.Description
Resume Exit_FilterClient_Click

End Sub

Thanks in advance for assistance.


  #3  
Old April 16th, 2010, 09:53 PM posted to microsoft.public.access
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Filter and Search button not work in Access 2007

DoMenuItem

When Access changes, especially big changes like the Ribbon, there's really
no way to know if the menu items are going to be the same. acMenuVer70 is
suppose to keep it backwards compatible, but.....

Even worse is using SendKeys, but that's a different story.

Instead use RunCommand. The first command sets the focus on the text box
that you want to search.

Col1.SetFocus
DoCmd.RunCommand acCmdFind

One Second! What precisely isn't working: the find at all or the leaving it
blank part? You may need to set up the default find settings.

Check out Application.SetOption. Below are some I used in A97 databases but
they seem to work in A07 also..

'Set some database defaults found in Tools, Options
' Put in the Open event of the startup form
' Set Default Locking to Edited Record
Application.SetOption "Default Record Locking", 2
' Set Default Open Mode for Databases to Shared
Application.SetOption "Default Open Mode for Databases", 0
' Set Default Find/Replace Behavior to Start of Field Search
Application.SetOption "Default Find/Replace Behavior", 2


In the case of "Application.SetOption "Default Record Locking", 2" Default
Record Locking has three choices and the one I want is the third so, of
course, I put in 2 for the arguement. That's because it starts numbering at 0
instead of 1.

Put the above code in the Open Event of your opening form. One other strange
thing is that the database may need to be opened and closed twice on the
user's computer for the change to take effect. The first time the database
opens, it makes the changes. The second time the changes are in effect.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Smitee2006" wrote:

I have a form view where users can see a listing of all clients in datasheet
view. On this same form is a button that users can push to be prompted for a
client name or a portion of a client's name in order to search the listing
and have it filter down the results. Hitting the button and leaving the
prompt blank will return the full client listing again. This button no
longer works now that I am working in Access 2007. Anybody have any ideas
why this might be? I've included the button's
underlying code for information.

Private Sub FilterClient_Click()
On Error GoTo Err_FilterClient_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70

Exit_FilterClient_Click:
Exit Sub

Err_FilterClient_Click:
MsgBox Err.Description
Resume Exit_FilterClient_Click

End Sub

Thanks in advance for assistance.

  #4  
Old April 16th, 2010, 11:34 PM posted to microsoft.public.access
张小建
external usenet poster
 
Posts: 3
Default Filter and Search button not work in Access 2007



"Smitee2006" 写入消息
...
I have a form view where users can see a listing of all clients in
datasheet
view. On this same form is a button that users can push to be prompted
for a
client name or a portion of a client's name in order to search the listing
and have it filter down the results. Hitting the button and leaving the
prompt blank will return the full client listing again. This button no
longer works now that I am working in Access 2007. Anybody have any ideas
why this might be? I've included the button's
underlying code for information.

Private Sub FilterClient_Click()
On Error GoTo Err_FilterClient_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70

Exit_FilterClient_Click:
Exit Sub

Err_FilterClient_Click:
MsgBox Err.Description
Resume Exit_FilterClient_Click

End Sub

Thanks in advance for assistance.


  #5  
Old April 17th, 2010, 03:08 PM posted to microsoft.public.access
张小建
external usenet poster
 
Posts: 3
Default Filter and Search button not work in Access 2007



"Smitee2006" 写入消息
...
I have a form view where users can see a listing of all clients in
datasheet
view. On this same form is a button that users can push to be prompted
for a
client name or a portion of a client's name in order to search the listing
and have it filter down the results. Hitting the button and leaving the
prompt blank will return the full client listing again. This button no
longer works now that I am working in Access 2007. Anybody have any ideas
why this might be? I've included the button's
underlying code for information.

Private Sub FilterClient_Click()
On Error GoTo Err_FilterClient_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70

Exit_FilterClient_Click:
Exit Sub

Err_FilterClient_Click:
MsgBox Err.Description
Resume Exit_FilterClient_Click

End Sub

Thanks in advance for assistance.


  #6  
Old April 30th, 2010, 08:49 AM posted to microsoft.public.access
jenny molina
external usenet poster
 
Posts: 2
Default Filter and Search button not work in Access 2007



"Jerry Whittle" wrote in message
news
DoMenuItem


When Access changes, especially big changes like the Ribbon, there's
really
no way to know if the menu items are going to be the same. acMenuVer70 is
suppose to keep it backwards compatible, but.....

Even worse is using SendKeys, but that's a different story.

Instead use RunCommand. The first command sets the focus on the text box
that you want to search.

Col1.SetFocus
DoCmd.RunCommand acCmdFind

One Second! What precisely isn't working: the find at all or the leaving
it
blank part? You may need to set up the default find settings.

Check out Application.SetOption. Below are some I used in A97 databases
but
they seem to work in A07 also..

'Set some database defaults found in Tools, Options
' Put in the Open event of the startup form
' Set Default Locking to Edited Record
Application.SetOption "Default Record Locking", 2
' Set Default Open Mode for Databases to Shared
Application.SetOption "Default Open Mode for Databases", 0
' Set Default Find/Replace Behavior to Start of Field Search
Application.SetOption "Default Find/Replace Behavior", 2


In the case of "Application.SetOption "Default Record Locking", 2" Default
Record Locking has three choices and the one I want is the third so, of
course, I put in 2 for the arguement. That's because it starts numbering
at 0
instead of 1.

Put the above code in the Open Event of your opening form. One other
strange
thing is that the database may need to be opened and closed twice on the
user's computer for the change to take effect. The first time the database
opens, it makes the changes. The second time the changes are in effect.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Smitee2006" wrote:

I have a form view where users can see a listing of all clients in
datasheet
view. On this same form is a button that users can push to be prompted
for a
client name or a portion of a client's name in order to search the
listing
and have it filter down the results. Hitting the button and leaving the
prompt blank will return the full client listing again. This button no
longer works now that I am working in Access 2007. Anybody have any
ideas
why this might be? I've included the button's
underlying code for information.

Private Sub FilterClient_Click()
On Error GoTo Err_FilterClient_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70

Exit_FilterClient_Click:
Exit Sub

Err_FilterClient_Click:
MsgBox Err.Description
Resume Exit_FilterClient_Click

End Sub

Thanks in advance for assistance.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:07 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.