Modules & VBA :: Option Button To Filter Query On Form

May 14, 2014

how i would filter a form using an option button. E.g i want to be able to click an option button that is called Filter user and it will filter the query based on who is logged in? and a Filter all option that will clear the filter and show all records?

View Replies


Reports :: Option Button To Filter Report With Dates In Access 2010

Jun 9, 2014

I have a retort that I want to use an option button to filter the report is a specific date is 48 hours before the current time. I'm not having any luck. Below is the code I have been playing with, but no go.

Private Sub NoMove_Click()
Select Case Me.NoMove.VALUE
Case 1
Me.Filter = "CLM = 'Now() - 48'"
Me.FilterOn = True
End Select
If Me.Filter = "" Then
MsgBox "The filter returned Null"
End If
End Sub

View 14 Replies View Related

Modules & VBA :: Disabling Option Group If A Button Is Pressed

Jun 16, 2014

I have an option group with 2 buttons in it, yes and no. It is set to default to No, but if someone hits Yes I want it to enable or turn on the next option group. Would just simply changing visible status disable it? Because I have a series of codes set up based on the second option group which read as:

Private Sub NumberOfAdditionalSites_Option1_GotFocus()
Me.AdditionalSitesLabel1.Visible = True
Me.AdditionalSitesText1.Visible = True
End Sub

[Code] .....

I do not want these to be visible if the initial option group is still set to no.

View 4 Replies View Related

Filter Form With Option Buttons

Oct 4, 2005

Hi All,

Just wondered if anyone can help me with this.

I have a form based on a query that has 16 options for values in one of the fields. I wanted to put an option button for each value on a form that would allow the user to view the records based on which option buttons were selected and have the form update accordingly.

The way I've gone about it is to have some code in the after_update event thingimy of each option button that updates a boolean value in a table that's linked to the underlying query the form is based on - but this just seems a long way to go about this... plus it's not working...

I've searched the archives for clues on this but haven't come up with anything. So I just wondered, is there a better way than what I'm doing. I'm not after somebody to do this for me, just point me in the right direction.

Many thanks,


View 3 Replies View Related

How To Create Filter Button On Form And Filter Records

Nov 26, 2012

How can I create a "Filter Button" on a form and filter my records? I create a textbox on a form and a filter button on the right. Then I click the filter futton, the filter function will search/match the content in the box through the datasheet. And then the results of the filtering will be pop up on the split form datasheet.

View 3 Replies View Related

Forms :: Filter Button On Form As Filter

Aug 1, 2013

I have placed a filter button on a form as a filter and written the following on-click event procedure:

DoCmd.SetWarnings False
DoCmd.RunCommand acCmdApplyFilterSort
Me.FilterOn = True

When I click the filter button I get a blank message box titled 'Microsoft Access" and an OK button, when closed the filter works perfectly.I have checked this procedure in other forms and it works without showing the blank message box.The only difference with this form is that its control source is a union query.

View 10 Replies View Related

Option Button - Use Text Instead Of Numeric Value In My Query/report

Apr 26, 2007

I am not sure what cateogory to choose for this question but I would greatly appreciate your help.

I have 5 buttons in my option group:
1. very often
2. often
3. occasionally
4. rarely
5. never

I have to produce a report using description of each button in my report, not numeric value. I heard something about global variable but I am not sure how to do it.

Many thanks,

View 1 Replies View Related

Use An Option Button On A Form To Select An Alternate Input Mask

Sep 25, 2006

I can create a customized Input Mask, however there are two possible structures that the data may take. I think that this should be doable by the use of two fields, if it can be done with one field it would be preferable for searching options. If I have to use two fields there would only be one or the other used for each record so I would prefer to have the unused field inhibited. Either way the code work is beyond my present ability, any assistance would be appreciated.

View 1 Replies View Related

Filter Button In Form

Aug 14, 2005

I have a form and I have placed a "Filter by form" button in it. Now I would like to create a second button that applies the filter (same funtions as the funnel icon on the toolbar. I tried using a macro with a command but when I click the first button and the form is ready to accept my criteria for the filter both button are greyed out. The only way I could apply the filter is through the toolbar. Any way of doing this second button?

View 1 Replies View Related

Filter By Selection Button On Form

Aug 8, 2005

Hi, I am trying to find code that will let me put a command button on a search form. When it is clicked I want the command filter by selection to filter the records. Basically copying the command when you click the button on the toolbar :rolleyes:

View 4 Replies View Related

Filter Command Button On A Form

Dec 12, 2005

I have a basic question.

I am trying to put a button on a form I have created so that I can use Filter by Form feature on it. I used the toolbox commnad button wizard and chose the Form Operations -> Apply Form Filter option for the button.

Unfortunately, this button does not work for this choice. In the Form view, if I click on this button nothing happens. Other choices in the wizard such as Edit Form Filter etc works.

Does anyone know what could be the problem? Is this an Access bug (i am using Access 2003).

If it is a bug, can anyone suggest what little modifications one might have to do to the VBA code underlying OnClick event for the button to make this command button work?

thanks a lot for the help

View 1 Replies View Related

Possible To Filter By Form Using A Command Button?

Mar 6, 2006

Hi, I'm an Access newbie. I've designed a fairly simple database to replace an old spreadsheet that was becoming unwieldy -- it was never really used so much for calculation as for data storage, so Access seems more appropriate anyway.

One of the functions I used in Excel was the autofilter, which I found very useful for zeroing in on specific portions of the data. I was wondering how I would do the same thing in Access, and then I discovered the "Filter by Form", which works just fine -- even better actually, since it has the whole and/or functionality.

I was wondering though if it would be possible to invoke "Filter by Form" using a command button. That would make it even easier, especially for some of my users who would almost certainly not know about "Filter by Form" otherwise.

View 14 Replies View Related

Filter Button On Split Form?

Feb 11, 2015

I have this code set to a button on a split form. It filters out all the blank records for the "Status" column.

Private Sub cmdFilterPendingStatus_Click()
Me.Filter = "[Status]"
Me.FilterOn = True
End Sub

I would like to do the exact opposite and filter out everything except for the blank records in the "Status" column.

How can I change the code to do this? I guess I should also mention that the "Status" field is a long text/memo box but I can easily change this to short text if I really have to. I realize that short text can do the blank filtering within the split form itself by clicking on that tiny arrow in the column header but I am trying to make it really user friendly where the user can just click a button to do this. The long text box has some options to filter but not for blank fields in a record which makes me think that this may not be possible to do if the Status field remains a long text box. Some examples for the filtering options that are available in the split form for a long text box are: Begins with, contains, ends with, etc... however, when I type "" to try and filter out everything except the records that have null in the Status field, it says that "" is not valid.

What can I do to get the results I need?

View 4 Replies View Related

Apply Filter To Control Button On A Form

Oct 11, 2004

I am trying to create a form with control buttons on the form for all the letters of the alphabet.
When a user clicks on the button for A, I would like them to only see records that starts with an "A".
I assume that I should apply an event to the button's OnClick-property, with a filter, but I can't seem to
get it right...any suggestions would be very much appreciated!

View 2 Replies View Related

Forms :: Filter Form Only By Clicking Button

Jul 22, 2013

Every Page has its on data source based on query, and they aren't related to Parent form or to each other. I want to set few buttons on every Page which would filter records in predefined way.Ex: one page has calculated field named [Za platiti]. It has numeric values form 0 up. I want to set one button to filter only records where field [Za platiti] is greater then 0, and other butt to filter only records where [Za platiti] is = 0. Other filters based on combo box I use regularly.

View 6 Replies View Related

Modules & VBA :: Create A Form Button That Will Automatically Email Each Row Of A Query Result

Jul 22, 2015

I am trying to create a form button that will automatically email each row of a query result to myself. At first the VBA code worked fine with a standard query. However when I use it with a query that contains a reference to a combobox form such as "<=[Forms]![Reminder]![Monthsleft].[Value] And >=0" I get the 3061 run-time error and "Too few parameters. Expected 1." I have included the VBA code below.

Private Sub Command9_Click()
Dim MyDb As DAO.Database
Dim rsEmail As DAO.Recordset
Dim sToName As String
Dim sSubject As String
Dim sMessageBody As String


If you intend to renew the lease, terms and conditions will need to be submitted for ECC for approval (regardless of changes or not in lease rates). If the terms have yet to be confirmed, it is important to begin the negotiation process as soon as possible with a target to provide the ECC submission at least two months prior to the commencement date of the renewed lease. To ensure sufficient time for ECC approval before the contract expiry date, please prepare the ECC paper and obtain necessary endorsements. Submission details can be found here. The ECC submission template and PSD Questionnaire could be found from this link

DoCmd.SendObject acSendNoObject, , , _
sToName, , , sSubject, sMessageBody, False, False

End With
Set MyDb = Nothing
Set rsEmail = Nothing
End Sub

View 2 Replies View Related

Can A Refresh Button On A Form Remove The Current Filter.

Mar 5, 2006

hi, i have a search form, and when you double click on the record, it opens that record in my main form (which opens filtered)

this is fine because it displays the record that i want to see

however, when i try to perform other tasks on my main form, such as choosing the id from a combo box and finding that record, it wont work because the form is still filtered, one way to get around this is to open and close the form, but is there a way that i can implement something into my refresh button that removes a form filter.

Private Sub Refresh_Page_Click()
On Error GoTo Err_Refresh_Page_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

Exit Sub

MsgBox Err.Description
Resume Exit_Refresh_Page_Click

End Sub

View 1 Replies View Related

Filtered Form - Remove Toggle Filter Button?

May 16, 2012

I have a form that opens with a filter on depending on what the user is supposed to see. When I deploy this, I don't want them to see the "toggle filter" button at the top. I tried making a custom ribbon like this:

<customUI xmlns="
<ribbon startFromScratch="true">
<tab idMso="TabHome" visible="false" />

[Code] ....

But it didn't seem to have any effect. When I applied it, it didn't even create "A Custom Tab". That might be because I have disabled everything that I could disable on the "Current database" options, I'm not sure.

View 1 Replies View Related

Forms :: Filter Form With Two Text Boxes / Command Button?

Mar 22, 2013

I am trying to filter a form by using two unbound text boxes that a user can enter in their criteria and then clicking a command button to filter the form using the criteria entered into the text boxes. My fields are as follows:

Bound Field: MondayD1
Unbound text box: txtMonday
Bound Field: SundayD7
Unbound text box: txtSunday
Command Button: cmdSelect
MondayD1 = txtMonday
SundayD7 = txtSunday

I have looked up several options using vb for the on click event of the command button but I either get an error message or the form shows up blank.

View 2 Replies View Related

Reports :: Using Command Button In A Form To Filter And Open A Report?

Jun 26, 2014

I'm trying to use a command button in a form to filter and open a report. I am able to get it to open the report, but I cannot get it to filter the report based on a combobox in the form. I've tried every combination of code I could think of and find. Here is what I currently have:

Private Sub FilterReport_Click()
DoCmd.OpenReport "Report", acViewReport, "First Name='" & Me.FName & "'"
End Sub

Option Compare Database
Private Sub Report_Open(Cancel As Integer)
Me.RecordSource = Me.FName
End Sub

"FilterReport" = Form Button
"Report" = Report
"First Name" = Report Field
"FName" = Form Combo Box

View 14 Replies View Related

Forms :: Command Button - Set A Default Filter And Filter On Load

Aug 13, 2014

I have a continuous form based on table "INCOMES" that shows all the payments received, which mediums can be (field "PMNT_MEDIUM"):

- check
- transfer
- taxes
- cash

Table "INCOMES" is filled using another form, but in this particular form I just want to show "check", "transfer" and "cash" (not "taxes") so that I can track all the cash incomes.

Note: taxes are loaded because they appear in my invoices and I need them there to reach the invoice total amount.So my form has a search bar which allows me to search by PMNT_MEDIUM listing all "checks", all "cash" or all "transfer". I can also search by payment number (meaning: check number). To that end I have a "search" button that applies the filter. And I have another button that "cleans" the filtering by "putting a "" in the search-bar and then calling the "on click" of the search button".

What I need is, no matter if I click over the "search" or "clean" button, it NEVER shows me the "taxes".Search button, on click code:

If IsNumeric(Me.busq_chq_med) Then
Me.Filter = "[PMNT_MEDIUM] like'" & Me.SEARCH_BAR & "*'"
Me.Filter = "[PMNT_MEDIUM] like'" & Me.SEARCH_BAR & "*' or [INVOICE] like'" & Me.SEARCH_BAR & "*'"
End If
Me.FilterOn = True

Clean filter button, on click code:

Call [Search button]_click
Me.Filter = "[PMNT_MEDIUM] like'" & Me.SEARCH_BAR & "*'"
Me.FilterOn = True

View 14 Replies View Related

Modules & VBA :: Date Range Option On Form

Jul 16, 2015

I have a form that has several drop down menus on it. I use the form to filter the database to only the options that are put into the drop down windows. I have it set up so that every window does not need to be filled in for the filter to work. Now I am trying to figure out how to put the option of a date range on my form as well. The code that I am using to make everything up to the date range work is.

Private Sub Search_Button_Click()
DoCmd.Close acForm, "Admin_CompletedPartSearch"
str_Form = "Admin_CompletedPartSearch"
str_Filter = "(1=1)"

[Code] ....

I can't figure out what I would need to do to make a date range also fit into this code but not to be required.

View 1 Replies View Related

Reports :: Option Groups To Filter Report

Nov 14, 2013

I have a report with 2 option groups, I cannot get both of them to filter the data simataneously, they will each inititally filter the data, but when the opposite group it clicked, the previous filter data does not remain filtered. I have posted the code for the two option groups, I know I'm doing something wrong.

First option group code:
Private Sub Frame43_Click()
Select Case Me.Frame43.VALUE
Case 1
Me.Filter = "allowable_weight Like '263000'"
Me.FilterOn = True

[Code] .....

View 5 Replies View Related

Option Button ??????

Jun 6, 2005

Lets say that I have a large list of locations in a listbox. What I want to do is to be able to have an option button that I can press in that will sort these locations. Like 3 or 4 different buttons, lets say like retail, finance, ect. Anyone know what kind of code I might have to use to make these sort on clicking the option button?

View 4 Replies View Related

Option Button - N/a

Mar 23, 2006

I'm working on a survey database, I'm having the users select the opton button to rate (1 - 10). Then as an after thought, I thought I would add a button that says N/A or doesn't apply. Course option buttons store numbers.

ANy idea's on how to accomplish this? What ever value gets stored I wouldn't include it in the results.

View 1 Replies View Related

The Option Button

May 30, 2006

Hi peeps,

I am encountering a few problems when I'm using the options button on a form.

Is there a way for the options button to display a different value instead of a -1 when the data is transfered to a linked table? i.e Good or Poor or Fair?

Also can a number of option buttons have the same control souce? at the mintue I have three buttons pointing at one control souce and when I select one of the buttons they all get selected.

Any help will be much appreciated.

View 14 Replies View Related

Copyrights 2005-15, All rights reserved