Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stop "filter by form" from disabling other command buttons on form 1

Status
Not open for further replies.

rust

Programmer
Jan 27, 2003
34
US
Hi All,
to make my form user friendly I placed two command buttons on my form so the user can "filter by form" easily.
The first button is neccessary as not only does it set the form to be a "filter by form" but it allows users to enter info in normally locked controls.

But when the first button is clicked the second button is not enabled so the user has to go to the tool bar to filter.

How do I get around this?

 
How are ya rust . . . . .

I assume by not enabled you mean the second button is dimmed? If thats the case, in the Click Event of the 1st button add the following:

Me!SecondButtonName.Enabled=True

TheAceMan [wiggle]

 
I tried that
I get you can't assign a value to this object
(for this test in the first button click event)

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 0, 3,acMenuVer70
cmdClose.Enabled = True

Maybe I'm not quite doing the make form query the right way

as strongbad might say
Me HEAD ES PLODE

Thanks for trying
 
rusty,
The second button (and any other button you wish to put on the form) will always be disabled when you are "filtering by form". Only controls which you can enter data will be enabled. So you can't enable the other button (which applies the filter). You'll have to filter another way.
Perhaps open another unbound "filter" form exactly like the original one with an ApplyFilter button that closes the "filter" form and applies the filter to the original form.
Cheers.
 
Hay rust!

You should be able to use the On Filter and On Apply Filter events to accomplish your needs. Use the On Filter event to Enable before the filter is applied, and the On Apply Filter after.

TheAceMan [wiggle]

 
Sorry.

But according to the above using On Filter and On Apply Filter.

This does not work.

Command72 is the name of my apply filter button.


Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
Me!Command72.Enabled = True
End Sub

Private Sub Form_Filter(Cancel As Integer, FilterType As Integer)
Me!Command72.Enabled = True
End Sub

My users have a sight disability and I have been asked to create HUGE buttons, as the menu buttons are too small for the users to use.

Lee
 
How are ya LeeJames75 . . . .

I have an DB from 2000 where A command button is enabled using the On Apply Filter Event and disabled by default. Works fine . . . . However the event is triggered from the Apply Filter in the menu bar not a command button. I guess thats the difference between the MenuBar execution and VBA. In either case its something good to know. I'm gonna have to checkout enabling Filter By Form using VBA. . . . .

Edski ! . . . LeeJames75 . . . . TheAceMan has learned something here ;-}

TheAceMan [wiggle]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top