AccessNoob98
New Member
- Joined
- Jan 2, 2014
- Messages
- 2
Hello
I currently have a form (call it Parent) with a subform (call it Child) and report in that subform. The subform contains a combo box and a command button that people can use to filter the report. For some reason, the value in the combo box is not being used to filter the report until after the command button is already clicked once. I am using a macro with the ApplyFilter command. This works fine when I try it on the Child form by itself, but when I put the Child into Parent as a subform and then modify the reference in the macro, it now requires that I click the command button twice.
For instance, if the user selects "Business" in the combo box and clicks the command button, I want the report to filter so only records that have "Business" in that specific field will appear. However when the user does this, the report filters so that no records appear (because the combo box was empty by default). Now if the user presses the button again without doing anything else, the "Business" records appear. Now if the user changes the combo box to anything else, it again requires two clicks. For some reason the value the user is selecting in the combo box is not recognized until after the command button is already pressed once. This also happens if I use the OnChange event in the combo box instead of using the command button, the "Business" records will not appear until after the user changes the combo box from "Business" to something else. The OnDirty event does not work as any Macro I put in that event is cleared when I save and close the form.
Does anyone have an idea of why this is happening?
Thanks.
I currently have a form (call it Parent) with a subform (call it Child) and report in that subform. The subform contains a combo box and a command button that people can use to filter the report. For some reason, the value in the combo box is not being used to filter the report until after the command button is already clicked once. I am using a macro with the ApplyFilter command. This works fine when I try it on the Child form by itself, but when I put the Child into Parent as a subform and then modify the reference in the macro, it now requires that I click the command button twice.
For instance, if the user selects "Business" in the combo box and clicks the command button, I want the report to filter so only records that have "Business" in that specific field will appear. However when the user does this, the report filters so that no records appear (because the combo box was empty by default). Now if the user presses the button again without doing anything else, the "Business" records appear. Now if the user changes the combo box to anything else, it again requires two clicks. For some reason the value the user is selecting in the combo box is not recognized until after the command button is already pressed once. This also happens if I use the OnChange event in the combo box instead of using the command button, the "Business" records will not appear until after the user changes the combo box from "Business" to something else. The OnDirty event does not work as any Macro I put in that event is cleared when I save and close the form.
Does anyone have an idea of why this is happening?
Thanks.