Solved

problem with acCmdFilterByForm

Posted on 2008-06-12
8
595 Views
Last Modified: 2010-04-21
Folks,
I have 3 command buttons:
Select Data      RunCommand acCmdFilterByForm
Locate Data     RunCommand acCmdApplyFilterSort
Clear Search    RunCommand acCmdRemoveFilterSort

When I click on Select Data all command buttons are disabled. I would prefer to manage filtering with command buttons. Is there a way to do this where the command buttons are disabled?
0
Comment
Question by:Frank Freese
  • 4
  • 4
8 Comments
 
LVL 75
ID: 21770999
" Is there a way to do this where the command buttons are disabled?"

Not sure what you mean?  Which command buttons?

mx
0
 

Author Comment

by:Frank Freese
ID: 21771107
When I click Select Data, which executes RunCommand acCmdFilterByForm, All command buttons on the form are disabled. To return the form to its orginal state I have to go to the toolbar and Apply Filter which reenables the forms command buttons. I would like to manage this in not using the toolbar.
0
 
LVL 75
ID: 21771320
"All command buttons on the form are disabled"

These are buttons you built, right?

You have code that is doing this, right ?

How does Apply Filter on the toolbar re-enable your command buttons?
0
 

Author Comment

by:Frank Freese
ID: 21771869
Yes, Here is all the code. How does Apply Filter on the toolbar re-enable your command buttons? Good question. I do not even know why they're disabled.


Option Compare Database

Private Sub cmdClearSearch_Click()

RunCommand acCmdRemoveFilterSort

End Sub
 

Private Sub cmdLocateDate_Click()

RunCommand acCmdApplyFilterSort

End Sub
 

Private Sub cmdSelectData_Click()

RunCommand acCmdFilterByForm

End Sub

Private Sub cmdClose_Click()

On Error GoTo Err_cmdClose_Click

    DoCmd.Close acForm, "frmLocateManHourSheet"

    DoCmd.OpenForm "frmMainMenu"
 

Exit_cmdClose_Click:

    Exit Sub
 

Err_cmdClose_Click:

    MsgBox Err.Description

    Resume Exit_cmdClose_Click

    

End Sub

Open in new window

0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 500 total points
ID: 21772011
humm.  Well, there is nothing here that is disabling the buttons.  But my guess is the acCmdFilterByForm is doing this.  I've never used FBF ... but I think it 'grays' out buttons - and only allows entry in text boxes.  
That's just how it works.
So, you might try this:

Private Sub cmdSelectData_Click()
RunCommand acCmdFilterByForm
    Me.cmdClearSearch.Enabled = True
    Me.cmdLocateDate.Enabled = True
    Me.cmdSelectData.Enabled = True
End Sub




End Sub
0
 

Author Comment

by:Frank Freese
ID: 21772589
thanks for looking into this with me. I have search the web and there are several comments similiar to this:
"While the "Filter-by-form" feature is enabled, the form is set up only to
allow for search criteria to be added, not to handle events, such as the
click of a button. Therefore, all controls that can't contribute to the
search criteria, such as buttons, list boxes, unbound text boxes, et
cetera, will be disabled. When the criteria selection has been chosen and the
filter applied with the built-in "Apply Filter" toolbar button (which looks like
a silver filter), the records that meet the search criteria will be
displayed in the form, and the buttons, list boxes, and unbound controls will
become enabled again.

http://www.tech-archive.net/Archive/Access/microsoft.public.access.forms/2005-10/msg00334.html "

Right now, I'll just have to stick with the Toolbar method.

Again, thanks!
0
 

Author Closing Comment

by:Frank Freese
ID: 31466606
many thanks!!!
0
 
LVL 75
ID: 21772633
ok
you are welcome.

mx
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now