Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

problem with acCmdFilterByForm

Posted on 2008-06-12
8
Medium Priority
?
670 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

916 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