enable command button on form while in filterbyform mode - ms-access

I'm trying to put a pair of command buttons onto a form to enable users to:
enter filter criteria, then
after they enter the criteria, apply the filter
The first is easy enough with "DoCmd.RunCommand acCmdFilterByForm"
The second would work with "DoCmd.RunCommand acCmdApplyFilterSort", except that I can't figure out how to activate my command button "cmdApplyFilter". The code "Me.cmdApplyFilter.Enabled = True" throws a runtime error.
I've looked at a lot of discussions, and it seems the only way to do this is by clicking on the ribbon or quick access toolbar. Does anyone know how to activate a command button on the form while in filter by form mode?

I'm pretty sure that what you're trying to achieve is not possible. The 'filter by form' view of the form looks to be a copy of your original form with only the input controls enabled to allow you to enter your filter criteria. If you think about it, it wouldn't make sense to allow full functionality. If you could activate buttons in this mode then you would theoretically be able to perform all sorts of actions that aren't appropriate in this context: add records, delete records, navigate through the records etc.
I suspect that the only way you will be able to get the functionality you want without using the ribbon bar buttons (what's wrong with the ribbon bar?) is to hand-roll your own filter form. Design a new form having controls to accept filter criteria and buttons to cancel or apply the filter. Sounds like a lot of hard work though to replicate functionality that's already built into Access out of the box.

Related

How to make navigation bar search box wait until pressing enter in MS Access?

I inherited an Access database and the main form uses the search box in the Navigation bar to find clients. The search function executes the search after every character that is entered, which is very slow over our network. There is a 2-4 second delay between each character.
Is there a way to make the search box wait until pressing "enter" before it executes the search?
I probably could add a custom search dropdown box , but I would like to avoid changing the users current practice (and save myself work) if at all possible.
Well, you're not providing us with much information.
I assume your current search is executed using VBA, probably by using the OnChange event on the search box. Move that to the AfterUpdate event, and you'll be done.
If you are using the inbuilt search facility located down by the record selectors, you are out of luck. Its behavior is hard coded into the Access exe program.
If you build your own search function then you can control exactly how it behaves. A great example is available here; http://allenbrowne.com/ser-62.html

How do I make a specific checkbox usable/clickable (not read-only) whilst a form is opened with acFormReadOnly in Microsoft Access?

We've got a checkbox on a form that we'd like to be able to check/uncheck even whilst the form is opened as read-only (it's a sales/product form and when an order has been invoiced, we want to prevent changes).
I know I could add a command button in its place and even make that button look like it's a checkbox with some images, or even set up a key combination to be used instead of the checkbox, but first I'd like to know if it's possible to simply exclude one checkbox from being read-only on a read-only form.
No. You must go the other way around:
Make the form read-write, then disable all controls bound to data fields except this single checkbox.

Hyperlink box (txtbox) on Access Form won't allow drop

I have a MS Access form that is bound to a query in the database. I added a textbox and added a row source to a Hyperlink datafield in the query. When I open the form, it won't allow me to drop a file into the textbox.
Here's the deal. When I follow this EXACT same process on a new form, it works perfectly. That is, I open a blank form and I bind the form to some new query, let's say qryNewIdeas. Then on the blank form i add a textbox, let's say Text0. Then, when I select Text0, I go to the data tab - row source and choose the dropdown arrow to select the hyperlink field, lets say NewIdeasAddress. I click SAVE and open the form. It works PERFECTLY.
BUT, when I repeat this on an existing form (the one where I need the thing to actually work), it does nothing. It adds and changes the textbox to a hyperlink box (I note this because of the blue underlined word that appears in the box). But it won't allow me to drop files to this location.
I tried commenting out ALL of my VBA code to try to make sure that something wasn't hindering it (say in an OnLoad event) AND I've checked all of the form and control box properties and they seem to be the same in both the existing form and the test form.
I can't determine why it works on one form and not the other; Solution needed.
If you have access to "the data tab - row source ..", you are in design view.
When you later open the form, you are in form view, a completely different animal which specifically prohibits design changes.
It sounds like you will have to rethink your concept.

Command Button Wizard doesn't start

I want to create a navigation button on a web form. (I use MS Access 2010 - Web database). I dragged the button on the form (the Control Wizard option is selected) but the Command Button Wizard does not show up
I double clicked on the button, but it just let me to edit button name. I also tried to click anywhere on the form - still nothing
How do I show Command Button Wizard Menu for my "Command120" button??
You have to enable the control wizards first. Go to the drop-down arrow at the end of the control group on the design ribbon and select use control wizards. Then insert the button again.
I had the same issue. I created the button the form in design mode and this seemed to get it working in layout mode again.
After all of the answers above, I still could not get it to work. What appears to be the problem in my case is that the wizard will not work inside of sub-forms. The solution is to:
Open the sub-form directly instead of designing it inside the parent form.
or
Create the button on the parent form, then cut or paste it to the
sub-form.
So this is a really old question and but I have found out the answer to the problem and will share in hopes that it may help someone in the future.
If the form is a "Web Form" the control wizards do not work. It must be a standard form. As far as I can tell there is no indication of this anywhere. To see the difference see the image below.
The form on top is a regular form and the one whereas the one on the bottom with the little globe is a web form. In order to create this kind of form Go to the create Tab and DO NOT select the options in the menu. You must select blank form from the Client Forms drop down as shown below.
There you will find the option to create forms that don´t have the little globe and those are the forms that work with the control wizards. Hope this helps someone else! This was a real pain to discover.
Enable the "Use Control Wizards" At Design tool tab.
Then add the button to Design are.
That's all
Make sure your wizard button in the drop down arrow is on if it is turn it off and then turn it back on then recreate your button. That worked for me in a layout view. Good Luck!!
If Sandy's answer didn't work for you, try to switch first to Layout View then proceed.
It worked for me.
I actually landed here looking for a solution. While I didn’t find it here I did figure out what I was doing wrong.
The action wizard only works with boundControls. So the area you are trying to use is not connected to a relevant table or field.
1st off make sure that you have the wizard activated/Turned on then proceed.
Option 1 [From LayoutView]
I was able to get the wizard to work by 1st deleting the button.
Then delete the cell you are dropping the button onto.
Then I stretched the cell with a field name to the right where I wanted my button.
Then I split the fields Horizontally.
Last I dropped the button on the cell I just created adjacent to the field & voilà the wizard came-up.
Option2 [From DesignView]
Again remove what isn’t working 1st. Then drop the button where you want. The wizard should pop right up. The button won’t be where you wanted it to be, but you can always move it once you get it setup.
I read that you tried it in DesignView & it worked, but crashed Access & you lost your Macros, so just a reminder to everyone try this with a copy or test db.
HTH
Links I found helpful.
+--------------------------------------------------------------------
https://stackoverflow.com/a/13010098/6158704
https://support.office.com/en-us/article/Introduction-to-controls-4a8cf5f2-d739-4ae9-b1e0-510c3f4d6975
+--------------------------------------------------------------------

ACCESS/VBA: How to create a ON/OFF type switch to allow record modification on a form?

I was using a combobox on my search form to select whether to consult or modify a record.
To make it more user friendly (IMO), I put a togglebutton on a form, which controls the .AllowEdits property of my form. This way you can easily switch from reading to writing.
However I run into a problem; once .AllowEdits is switched to false, the togglebutton is not clickable
anymore !
What are my options ?
You must use a command button instead. It will not get locked.
You will however run into similar problems with other controls like a combo box you would use for quick searching a record. If you have that problem, use the solution here to lock/unlock all your bound controls.