Forms :: Selecting Between One And All Items In A Parameter Control?
May 25, 2013
I have a Parameter form which provides various parameters to my queries. The Parameter Form has a Combo box with a list of 50 health facilities which the user can select according to their needs.
There are instances when a user needs data from just one health facility and at times the data is needed for all the 50 health facilities in the district.
How do i address both needs without having to keep adding and deleting the criteria in the underlying queries?
I have added the 'if' condition below in the queries criteria so that if the user does not enter a facility in the combo box, it runs all facilities and if they enter a facility name then the data in the reports is limited to that health facility.
IIf(IsNull([Forms]![Parameter Form]![Combo27]),"",[Forms]![Parameter Form]![Combo27])
It does not work.
Is the expression or VBA code supposed to be entered in the Query or in the Parameter form and how do I make it work?
View Replies
ADVERTISEMENT
Nov 28, 2014
Now I have a combo box "cbo_items" and a text box "txt_selectedItems", I want to populate text field with items selected from the combo box, every time i select an item it appears in text box and to be separated with comma, so text box appears like this ( item1, item2, item3), and after finishing the whole thing the result appears in lable "lbl_result" as "total items selected: 3 items".
View 1 Replies
View Related
Jan 2, 2007
I want to be able to perform an AND search on a field where both specified values must be present for an item to be selected.
I have a table with some properties of items. Each record in the table is for a specific item and one of its properties. Say for instance that I want to list the items that are described with both "red and green". Assume that there are entries for widgetA to widgetG with colors "red, blue, yellow, purple" and widgetB and widgetE also has the property "green" in addition to the others ... the query should return widgetB and widgetE only.
I tried to use MSAccess 2003 query builder but cannot get the AND result to work. I switched to an OR and verified that the two values I am searching for do exist for two items in my table.
Here is the SQL statement that did not work.
SELECT Properties.PropertyIndex, Properties.HerbOilLink, Properties.PropertyTypeIndex, Properties.PropertyDescriptionIndex
FROM PropertyType INNER JOIN Properties ON PropertyType.PropertyTypeIndex = Properties.PropertyTypeIndex
WHERE (((Properties.PropertyDescriptionIndex)=80 And (Properties.PropertyDescriptionIndex)=15));
View 3 Replies
View Related
Apr 30, 2005
i have a combo box containing dates, however it will only display the date at the top of the list, no matter which date is selected.
any help would be gratefully excepted!
cheers
View 2 Replies
View Related
Nov 23, 2006
Hello to all .
Have you got any idea ?
I have a List Box in a table and it is set to permit multiple items selection
from it .
The fact is I can select, as I wanted, multiple items from it through
the Form but when I go to the correspondent table to see the results
the selected data from the List Box isn't there .
Note all data selected from the List Box is visible trough the Form but
not the table .
Has this problem anything to do with mismatch in data type configuration on the table ?
Lots of thanks in advance
Miguel
View 1 Replies
View Related
Feb 1, 2005
Is it possible to select more than one item in a combo box? I have attached a sample of a database I am working on. I have a table called Interests and on the Bookings form, I would like to be able to select more than one interest in the Interests combo box, but I can't figure out how to do it. In databases I have seen, you simply have to hold down ctrl or shift to make multiple selections - that's what I want to do.
Can anyone help, please?
Thank you!!
View 13 Replies
View Related
Jan 30, 2007
hello once again
Scenario:
I currently have a form that the users can browse through listings of items for sale. While going through the records, they can mark with a checkbox of which items to include in a report to send in an email. The check box is currently part of the listings table, and i then run a query to pull items with the box checked, then put those in to a report, then they can email.
Problem:
about 5 users use this database, so if one user is selecting items that they want it's going to cause a problem for another user to select only the items he wants since it is all updating to the same table. Ex, if I select items 2 and 3 and another person selects items 4 and 5, when I click to show the report, its going to show items 2,3,4,5. Make sense?
Solution:
Since there are only 5 users, I made them all aware of this, and also created a reset selected email checkbox button, that sets the checkbox back to unchecked so the next person can select their own items and email. There has to be a better way to fault proof this, I just can't think of one. Any ideas would be greatly appreciated!
View 2 Replies
View Related
May 19, 2012
I have a report, which shows all unsold items for a particular auction date, and I have created a form using this report.
I'd like my sister in law, to be able to go through and easily select which items to relist, and which to return.
I've tried using a subform, but I've either not done it correctly, or its not quite the right tool for the job. I've tried listbox control but can't get it to work properly either.
Once she has gone through the list ticking one or the other, I'd like to be able to automate with a button "Relist" and a button "ReturnItem".
I'd like Items to be returned - to automitcally close item off so it no longer incurrs a weekly listing fee and change status to "ReturnToSeller" and the relist ones, to create a new entry line into the main item table, with replicated information, except it clears out the "lot number", as they enter that manually when the generate a new list for the next auction, my ID numbers remain current and unchanged but the tableID is automated to a new one which is my key number.
then on my invoice, I get for instance, 3 rows for one Item, which could have 3 different lot and ID numbers, and get a listing fee of £1.20 for each week you see.
How can I automate the actions to relist and Return to Seller?
View 3 Replies
View Related
Jul 22, 2015
I have a combo box that has three items in it. Name, ID_Num, Date
I need to use ID_Num and Date to filter the results of query. I can use one or the other but not both. I have tried ListIndex but apperently am writing it wrong in the expression builder.
[Forms]![TableName]![Combo0].
[ListIndex]????????????
I have tried =0, =1, =2 after the
[ListIndex] but it doesn't work.
How do I use two items from combobox in a query?
View 2 Replies
View Related
Oct 11, 2006
I have a value list combobox (cboShift) on my form with selections as "1st Shift";"2nd Shift";"3rd Shift" and a subform that should filter my records based on the shift selected on the mainform.
My data fields in my query are [TimeStart], [Time Stop], [other fields].
I would like that e.g. when "1st Shift" is selected, it should filter my records based on the [timeStart] that falls within the range, and so on.
I really don't know how to handle this, even to set the time range parameter for this...
I have written this function for a start. To continue, i ask for your help or guide. Please help????
Function fShiftWorked(strTimeStart As DateTime)
Dim strOperatorStart As String
strOperatorStart = FormatDateTime(([tblTimeLog]![timeStart]), vbLongTime)
If strOperatorStart >= #8:00:00 AM# And strOperatorStart < #5:00:00 PM# Then
strTimeStart = "1st Shift"
ElseIf strOperatorStart >= #5:00:00 PM# And strOperatorStart < #12:00:00 AM# Then
strTimeStart = "2nd Shift"
ElseIf strOperatorStart >= #12:00:00 AM# And strOperatorStart < #8:00:00 AM# Then
strTimeStart = "3rd Shift"
Else
strTimeStart = "2nd Shift"
End If
End Function
View 6 Replies
View Related
May 5, 2015
I have the below code behind a form so that a combo box will display a specific list of items based on the data in another combo box on my form.
I have two copies of this same form for two different departments. One of the forms works like a dream. However, when I copy that form, change the name, and update the code as pictured below, the form is asking for a parameter FROM MY ORIGINAL FORM and will not requery the combo box. I can't figure out why...there is no reference to the original form in my VBA as you can see below. I tried deleting the form and re-creating it, I tried deleting the code and re-typing it to no avail.
Private Sub cmboType_AfterUpdate()
Me.cmboAction.RowSource = "SELECT tblStatusList.Status FROM tblStatusList WHERE (((tblStatusList.Department)=[forms]![frmInquiryFraud]![cmboType]));"
End Sub
View 4 Replies
View Related
Feb 13, 2006
Hi,
Have been developing an Employee DB which includes sickness records and interview information. Have mangaged to sickness records but now I need to link interviews to these specific records which is where I am having a problem.
All sickness records are shown on a sub form and I attached a button at the end of each record so that I can can add interview information that is linked to the sick record through SickID but just cannot get it to work.
Have attached relevant forms and tables and could really do with some help as am pulling my hair out here.
Cheers
View 2 Replies
View Related
Oct 13, 2015
I am at my Login Screen, I want it to return to the Login Screen if you select "NO" and Close the DB if "YES"
Here is my current code:
Private Sub Form_Close()
If MsgBox("Would you like to EXIT the Database?", vbYesNo, "Quiting Database") = vbYes Then
Application.Quit
Else
???
End If
End Sub
View 5 Replies
View Related
Aug 23, 2006
How can you control SQL statement parameters with VBA? The SQL statement will not accept a variable.:confused:
View 1 Replies
View Related
Aug 7, 2006
I can't figure out how to further explain what i needed to do. I hope the attached file could solve my issue.
Thanks for your time!
Sheila
View 2 Replies
View Related
Oct 21, 2014
i have a question concerning setting of parameters in a query:
I have a query with a parameter and a form with a control ... however, i want the value of the control to be used as parameter in the query.
For example a checkbox "chkb". Now i specify a query as RecordSource (or ...set ... i'm not sure) for a subform and i want it to change the parameter-value with the value of "chkb".
Is it just necessary to assign the name of the parameter correct (in the query-definition, put smth like [Me].[chkb].[Value]), or do i have to set the parameter in VBA ? And anyway, is it clear what i mean ?
View 3 Replies
View Related
Feb 7, 2012
I have a pop up form that is run by a query that needs to grab the parameter value from a field on the open form. It grabs the value for "QuestIDfrm" from the form "frmQuestionDetail" using the statement below pasted into the query parameter.
Code:
[Forms]![frmQuestionDetail]![QuestIDfrm]
This works fine when I call the pop up from the form "frmQuestionDetail". What if I want to call this same pop up form from another form that has the same control (QuestIDfrm).
Is there a generic syntax that would grab QuestIDfrm from the current open form? Something like
Code:
[Forms]![CurrentOpenForm]![QuestIDfrm]
View 2 Replies
View Related
Apr 28, 2007
I have a text box in a report, with it's control source property set to =[BegDt].
Upon loading the report a message box pops up and asks the user for the value of [begDt]. This occurs 3 more times for 3 other parameters.
Now I want to change the design of the report so I decided to put these 4 parameters on a form so the user can fill in the 4 values all at once rather than responding to 4 message boxes that pop up when you run the report.
The problem is now the control source properties in all the different text boxes need to be changed to [forms]![frmABC]![txtBegDt] etc.etc. There are over 100 text boxes in this report that make reference to the 4 different parameters.
Is there a replace command I can use to change all the occurrences in the text boxes or perhaps a simpler way would be to pass the values to the report through code.
I tried placing this in the report header's format event and it doesn't seem to have any effect.
Code:Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)begytd = [Forms]![frmABC]![txtStDt]endytd = [Forms]![frmABC]![txtEndDt]curmo = [Forms]![frmABC]![cboMo]curyr = [Forms]![frmABC]![cboYr]End Sub
I should mention that the report uses a table (tblRecap) as it's record source. I tried using a query that refers back to the form for the parameter values but that means I have to use the query as the reports record source and that creates a problem because the report needs fields from the table to perform calculations.
Can someone help me with a solution please.
Thanks for your time.
View 2 Replies
View Related
Jul 15, 2014
I have a form using a query as a control source so that is prompts the user for a parameter when they open the form.
I also have a listbox that is calling the same query.
The issue I am having is when I open the form it will prompt me twice to enter the same parameter.
Tables:
tblship
tblconsignee
tblbill
tblinvoicedetails
Query
qinv
Form
frminvoice
When the user enters the invoice number it populates the ship, consignee, billing address information. I have the list box to display line items for that invoice.
Currently I just have them enter the invoice number twice.
Is there a way I can take the user input and apply it to my other query?
View 3 Replies
View Related
Sep 24, 2013
I added a new field to one of my tables and query, but when I try to add a control for that field into my form it is not recognising it and the field isn't appearing in the sources for the form, even though the table is sourced to the form? Or am I going to have to do the usual and redo the entire form because I made a minor adjustment?
View 1 Replies
View Related
Jun 18, 2014
I have a form with a tab control, inside the tab control I placed an ActiveX control (Microsoft Web Browser). These are at the bottom of the form.
Everything displays fine if the entire form fit on the screen but if the form is too long and I scroll down the browser control is getting obscured by the tab control and getting chopped off (the contents are covered). It is as if the browser control is staying in space where it was and moving behind the tab control as I scroll.
This problem does not occur if I place the browser control directly on the form. Also I note that the browser control is sitting correctly within the tab control.
I have been through all the settings and properties of both controls and haven't been able to fix it. I searched all over the web but no one has previously stumbled across this one by the look of it.
See the attached image ...
View 3 Replies
View Related
Jul 31, 2013
I just want to know how to manage items in set and individual item. Suppose my product list are
individual items = A,B,C,D,E,F,G,H,I,J,K
and 5 pc set = A,B,C,D,F
and 3 pc set = G,H,K
How should I design the table. Previously I designed the table for individual items and whenever orders for set is placed user had to enter individual items with quantity.
E.g. order is for 5 pc set = 3000
A=3000
B=3000
C=3000
D=3000
F=3000
Now I need to just say 5 pc set and it should be automatically populated. And also if order have combination of individual and set items.
View 3 Replies
View Related
Nov 4, 2013
how to neatly arrange check boxes within a box in a form? They're all scrunched up, what I wanted to do was select size / space and reduce the vertical spacing, but for some reason that's unavailable. If I select stacked it pushes them outside of the box..
View 3 Replies
View Related
Feb 3, 2014
In Access 2013, I would like to be able to choose more than one value from a combo box, but I believe this is not possible. However, I can prepare a list box and set the Multi Select to Extended. Doing this, I can indeed select more than one value, but I don't know how to get those values into a text field in the form. (If poss, they would become comma separated in that field). Ideally, the code would call the list box because it would take up too much space if it were there all of the time.
View 2 Replies
View Related
Aug 12, 2013
I have a combo box in which I wish to show the Person_ID's of every record in the table TBL_Person, except those which are returned by a separate query. Is this possible at all?
View 1 Replies
View Related
Jul 16, 2015
I have a form where there are 2 list boxes: Part_List and acbPartList. acbPartList has multiselect enabled and what I want to do is be able to select multipler records in that list box and then press a button to add those selected records into the other list box. Here is my code for my button:
Private Sub addItemButton_Click()
Dim varItem As Variant
With Me.acbPartList_Existing
For Each varItem In .ItemsSelected
Me.Part_List.AddItem (varItem)
Next
End With
Me.Part_List.Requery
Me.Refresh
End Sub
I'm not sure if passing varItem is correct, but regardless, it isn't working because Part_List is based off of a query, its not a value list.
View 3 Replies
View Related