How To Deselect A Chosen Option?
Feb 4, 2005
I have a form that opens by showing an option group:
Search by: 1-Team 2-Rep
Based on the option chosen (1 or 2) another set of boxes and options appear that let you select the team or rep and the report you want:
If 1:
Combo: Team A/Team B/Team C
Option Group: 1-Report A, 2-Report B, 3-Report C
If 2:
Combo: JohnDoeRep/JaneDoeRep/SchmoeDoeRep
Option Group: 1-Report D, 2-Report E, 3-Report F
I have specified the logic for which report to run in the OnClick event of the Run Report button based on the conditions above.
My problem occurs when a user for example chooses Option 1 and runs a report, then comes back to the form and wants to run a report under Option 2. When this happens, the report selection for Option 1 stays selected, and as a result, both reports are run when the Run Report button is clicked.
How do I get the Form to deselect any options in the old selection if a user switches from Option 1 to 2 or vice versa?
Many thanks to all who help!
View Replies
ADVERTISEMENT
Aug 2, 2005
Hi I'm a real newbie at this but basically I have a form displaying three lots of contacts Expediting, Quotation & Miscellaneous contacts.After choosing the company name from a list box it displays the Expediting, Quotation & Miscellaneous contacts info - but doing it this way there isnt much space on the screen to show all the Contact names,Telephone fax & email addresses clearly& at a decent size.Apart from the company list box I want to have a list box/combo box with:
Expediting
Quotation
Miscellaneous
and then after choosing Expediting, Quotation or Miscellaneous from the list/combobox i want it to take the relevant data from the Expediting, Quotation, or Miscellaneous contacts sections and only display the information relating to those sections only, therefore allowing me to have bigger text and not so cramped display so everyone can read it ok and get more info on the screen for each contact group.
If anyone could help it would be much appreciated!!!! Thankyou in advance for any help. Be gentle with me I am a newbie,lol.
Thanks again
View 2 Replies
View Related
Aug 17, 2006
I have a button when you click it, it runs a append query to change all true check boxes back to false
my problem is after it runs the append query the user see a long error message, then to see the check boxes change .....you have to go back and click the button again.....not very pretty
here is what I have
Private Sub btnDeselectAll_Click()
DoCmd.OpenQuery "qupdNotificationSelectionNo"
Me.Form.Refresh
End Sub
Thanks in advance
View 3 Replies
View Related
Jan 25, 2006
hi all,
ive ste up a form with list boxes being used as filters but once ive made a selection i can deselect it to clear the filter. any ideas where the stetings are to control this?
greg
View 3 Replies
View Related
Sep 29, 2005
I made sure I did a search for this topic before I posted, so please don't flame me.
I'm trying to do something that in theory does not seem hard to do, but for some reason I can't translate it into code. With using a ListBox, I understand how to do a simple "when a value is selected, the remaining values are deselected" code. What I am trying to do is:
When the form is opened, the default selection of the listbox (lbOfficeLocation) is "***All Offices***".
If the user selects any other value (multiple values can be selected), the value "***All Offices***" is deselected.
If the user selects the value "***All Offices***", all other values are deselected.
For some reason or another, I can get (1) & (2) to work, but I cannot get (3) to work. After I make my initial selection that forces the deselection of value "***All Offices***" and highlights any other individual or multiple values, I try to re-select "***All Offices***" and it won't highlight, and will not deselect any of the other selected values.
I have tried multiple ways to code this, from using a For loop, If statement, and even a Select statement (Case 1, Case 2, ...), even using both Click() and AfterUpdate() as the event procedures, and nothing. I don't know how to use a IIF() statement very well, but do I need to use one of those? The code for what I have so far is below:
The name of the Listbox is "lbOfficeLocation".
Private Sub lbOfficeLocation_Click()
Dim holder As Integer
For holder = 0 To lbOfficeLocation.ListCount - 1
If lbOfficeLocation.Selected(holder) = True Then
Me.lbOfficeLocation.Selected(0) = False
End If
Next holder
End Sub
This code is for the deselection of value "***All Offices***" if any other value is selected. Please help me find the code to help with scenerio (3) as listed above, while still maintaining (2).
Thank you in advance, and feel free to ask for any additional info.
View 6 Replies
View Related
Sep 9, 2013
I am using a yes/no field to select a number of records for a report. Is it possible to deselect and turn them all back to no at one time when finished with the report. It would be nice if I did not need to deselect all of them individually.
View 3 Replies
View Related
Jul 2, 2014
I am using Access 2010.
I have a form with three listbox. My issue is this, when I go from listbox to listbox the selected item in the previous listbox is still selected.
I would like it so when I go to the new listbox, then the previous listbox selection will no longer be highlighted.
I use the follow code, which works but the user has to double click on the listbox with the focus to make a selection.
Code:
Me.listbox.listindex = -1
I have the code in the lost focus event of the listboxes.
Is there a way to prevent the double clicking?
View 7 Replies
View Related
Oct 20, 2014
I have a form where users can enter the beginning and ending dates into text boxes. They could also do it for the number of the week (1 to 52) or a single text box for the quarter.
I set up VBA code where, if you click on a button, it will clear out the data from the other two options before a query is run based on the parameters in those text boxes. Here's a sample piece of code.
Code:
Private Sub btn_UseDates_Click()
Dim lngGreen As Long, lngWhite As Long
lngGreen = RGB(0, 255, 0)
lngWhite = RGB(255, 255, 255)
Me!txtDateFrom.BackColor = lngGreen
Me!txtDateTo.BackColor = lngGreen
Me!txtWeekFrom.BackColor = lngWhite
Me!txtWeekTo.BackColor = lngWhite
Me!txtQuarter.BackColor = lngWhite
Me!txtWeekFrom = ""
Me!txtWeekTo = ""
Me!txtQuarter = ""
End Sub
I've tried setting those txt boxes to Null and I've tried both "" and " ", but to no avail. The query will work if the three types of ranges (date, week, or quarter) are on OR lines, but not on the same line.
View 5 Replies
View Related
Sep 29, 2005
Hi, I'm in the process of building a program in access 2003 for estimating roofs, I've ran into a little problem, as described below. any suggestions would be very useful
Populating the text box’s that relate to the chosen combo box’s with the sum of a calculation.
In other words if X combo box is chosen (There are many combo boxes to choose from) populate xx text box with the sum of a calculation.
Refer to the print screen example of my program: http://www.roofmart.net/Rest.asp
Notice under the label felts the 15lb 36” felt combo box is chosen and it displays the value of 11 and next to the combo box is a text box that displays the value of 25 The calculation will be (11*25) = 275 this value of 275 must be added to the text box values that are being shown in the forms header under 30yr where it reads $4,606.80 and 40 yr $6002.80 only, this is because the 30yr comp and the 40 yr comp combo boxes are the only chosen roof types under the label roof types above the felt label.
Hopefully this makes sense.
Thanks -- Any help with be greatly appreciated.
View 3 Replies
View Related
Feb 7, 2015
I have a form that adds a record to a table in the database.I want that when i choose a value from a combobox in the form, it will change the value of another textbox according to what value was choosed.So essentially what i did is simply go to the combobox AfterUpdate and there i used this code:
If Me.Combobox.Text = "Solid" Then
Me.TextBox1.Text = "grams"
ElseIf Me.Combobox.Text = "Liquid" Then
Me.TextBox1.Text = "ml"
End If
But i encounter 2 problems:
1. When i set a default value to the textbox (which i want to), the changing of the value in the combobox doesn't do anything whatsoever.
2. When i remove any default value from the textbox, the changing of the value in the combobox does change the textbox to the corresponding value but then gives run-time error 2185: "You can't reference a property or method for a control unless the control has the focus".
View 2 Replies
View Related
Jun 20, 2014
What i am try to do is have specific text boxes or items appear on the form depending on the combobox item you have chosen.
For Example
Combobox
CAR
CAKE RECEIPE
CLOTHING
if car is chosen 2 text boxes appear example car manufacturer, Car name. If Cake recipe is chosen a larger text box appears, if Clothing is chosen another combo box appears and gives you more options.
View 5 Replies
View Related
Jan 29, 2015
I am having is that the auto-number value on his machine is different than on mine so anytime I try to add data in testing, it tries to create a primary key value that already exists in the table.Can I set the auto-number "counter" on my computer to a chosen value so I don't have these issues?
View 14 Replies
View Related
Dec 22, 2014
I have a command button (well, I have a few) that I would like to open a report, first opening a form that allows the user to enter a start and end date.
The code so far is:
On Error Resume Next
If Err = 2501 Then Err.Clear
DoCmd.OpenForm "DateSelect", acNormal
DoCmd.OpenReport "All Events Report", acPreview
Now, when run, this code opens the form (DateSelect), but the report starts to run immediately - the On No Data event of the report kicks in (message box along the lines of "No data, closing report", so before the user has the opportunity to enter the dates, the report has decided that there is no data an closes.
Is there a way to pause the opening of the report until after the OK button is clicked on the pop up form?
Just for the sake of clarity, the pop-up form DateSelect is used to open various reports, so I can't add the open report command to the code for the OK button (that I know of?)
View 8 Replies
View Related
Oct 14, 2013
I have started converting our Access 2003 to Access 2010 applications. In the past we have used the Calendar to pick a date to place in a textbox. I noticed that this feature will not work in Access 2010.
So I looked around and saw several references to using the calendar pick feature to a textbox...but without success.
How to have a textbox with a calendar icon next to it to populate the chosen date in the textbox?
View 2 Replies
View Related
Mar 12, 2015
I have a report with a table as the row source. I have command buttons that opens different forms and allows the user to choose criteria, the form then filters the report based on the chosen criteria in the form, but if I use the destination city form to filter the report by destination city, then filter the report using a different form, the destination city filter is lost, is there a way to filter the report with a form by say destination city, then further filter that dataset with another form for say location city.
View 14 Replies
View Related
Mar 14, 2008
I’m really stuck on how to create: Check Boxes/Option button/Option Group in VBA.
Could someone help on either all of them or some of them please?
Thanks
Richard
View 2 Replies
View Related
Jul 22, 2014
I have a modal form which has a single record which is then linked to a sub-form on the same modal form. This all works fine and shows the relevant record and sub records but I want the modal form main record to change dependant on the record selected in the subform (which is basically order item history.
I found some code on another site which seemed to work for others but for me I am getting Run-time error 2465 and it doesn't like my reference to 'Me' - is this because it is a modal form?The code I am using is:
Public Function GotoRecord(RecordID As Long)
Dim rst As DAO.Recordset
Dim strCriteria As String
Set rst = Me.RecordsetClone
strCriteria = "ID = " & RecordID
rst.FindFirst strCriteria
If rst.NoMatch = False Then
Me.Bookmark = rst.Bookmark
[code]....
View 1 Replies
View Related
Aug 18, 2006
I am using an Access database for a foreign language dictionary project.
One of the forms I use is populated by a query (qryLemmaTable) to retrieve information from tblLEMMA.
This form works precisely as I intend it to work, but there is a glitch on it that is driving me mad.
The form in question has an option group with 11 radio buttons that correspond to the parts of speech associated with each word in tblLEMMA.
When I click on the button optAdjective I apply a filter and the only records that are displayed are adjectives. (The same applies for Nouns, Verbs, Prepositions etc.)
Here is the glitch: even though the radio buttons apply the filter correctly, no “black spot” appears in the button. Other signals on the screen let me know what word type is selected, so I can accomplish what I want, but I want the “black spots” too!
Perhaps this will be a clue: For each radio button I use the following code in the GotFocus event.
Me.FilterOn = False
Me.Filter = "wordtype = 'A'" ‘(or N, etc)
Me.FilterOn = True
And this for the Lost Focus event
Me.FilterOn = False
Thanks for the help.
View 3 Replies
View Related
Aug 22, 2005
Hi
I've got an Option Group with 3 options; Yes, No and Future.
I also have a range of Check Boxes; 1 for every day of the week.
When one of the check boxes is selected I want the Option Group to change to Yes.
Currently, the Option Group defaults to Future and No will only be available by manually selecting it. This doesn't need to be changed.
Any help will be greatly appreciated!
Cheers
View 2 Replies
View Related
May 28, 2014
I have a table that consist of pricing for different types of products:
Table name: Costs
ID TYPE EastNew EastRenew WestNew WestRenew
1 500 4100 1000 4400 900
2 501 4100 1000 4400 900
3 600 3400 900 4600 1200
4 700 3700 1300 4900 3300
I have a form that consist of many fields that the user needs to manually input data. 3 fields on that form are the criteria i need to determine which pricing to use back on the table. The first field, which name is LTYPE, is a combobox that the user needs to choose as its type (i.e 500,501,600,700). The second field, which name is EastCoast, is a checkbox (Yes/No) that tells me if it's East Coast (East = yes and West = No). The third field, which name is NewRenewal, is a combobox that the user chooses NEW or Renewal).
Example 1, if the user chooses type 501, checkbox is YES for East, Product is NEW. Then the pricing is $4,100
Example 2, if the user chooses type 700, checkbox is unchecked for NO (which is West), Product is Renewal. Then pricing is $3,300
I would like the unbound field to auto determine the pricing based on the 3 criterias chosen. I read around the forums that Dlookup would be the function for this, however, i tried many times but it did not work.
View 6 Replies
View Related
Aug 28, 2004
Hi,
is there any (reasonably simple) way to select or deselect multiple items from the List Box with individual clicks without using Ctrl key. Eg first click on an item would select it leaving all other items as they are, subsequent click on the already selected item would deselect it etc. I hope this is not too confusing and I would appreciate some help.
Thanks!
View 1 Replies
View Related
Feb 9, 2015
I do not have the privileges to write code, but can use macros and Expression builder. I have written a bunch of queries and made reports for each of them. What I want to do is to be able to choose from the list of reports and view the chosen one. If that cannot be done without code, then to choose from a list of queries and then view the report made from the query. The user needs to be able to choose.
View 2 Replies
View Related
Jul 25, 2013
I stumbled upon the Option Group function just yesterday and, happy as a clam, I created a group with 2 options in radio button style. I assigned the values to a field called Registration_Type as the 2 options are "Confirmed Registrants" and "Prospective Attendees".
[Great. That part works well. When I look at the table, a 1 or a 2 is in that field so it's great to know how to control accidental ticking of radio buttons (previous 450 records or so didn't have this option group functionality so one might easily tick one of the buttons. So one part of controlling option group I know I can handle via the table itself for now.]
The challenge is how to ensure the user always ticks one or the other ... I went back to the main table and tested the 'required entry' option for the Registration_Type field but forcing an action like this is not ideal in my mind. The usual error message vagueness for the average user is no good and I don't want to limit the user so much.
Is there a way to simply have a popup come up warning that neither radio button was ticked? Perhaps something linked to the form - i.e., maybe "after update"?? I only learned about attaching code to before and after update on controls a couple of days ago, so not sure if this would be best approach.
Just something to let the user know that nothing has been ticked in the option group as that controls in which of 2 reports the data will show up in so any record not ticked might mean a registrant being left out, which would be rather disastrous <g>.
View 1 Replies
View Related
May 23, 2006
Hi,
I have a list of four options and i want the user to be only able to click one option and not have multiple options ticked, so once one option is clicked the others cant be clicked whilst that one is clicked
in other words you have to untick your option to pick a differnt one
View 3 Replies
View Related
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
Apr 25, 2006
I made on option box on a form called Status. The 2 radio buttons are marked Open = 1 and Closed = 2. Is it possible to open a query based on what the user selects. In the query I want open to stand for Is Null and closed would be Is Not Null. I know this sounds unusual but it works in the query they way I want it to. Is this possible? Thanks...
View 2 Replies
View Related