"Dynamic" Criteria For Combo-Boxes

Jun 14, 2006

Okay, this might be difficult to understand or tough for me to explain properly. Basically it's like this. I choose a cltContactID (a foreign key tied to a main Client's Contact's table). Then, in the next field, I'm choosing a source (for example: General Hospital) that referred the client to my company - call this refSource.

Then, in some cases, or most, I need to identify the person within that refSource that actually did the referring (eg, a Social Worker named Gene). Now I deal with 20+ Hospitals, 30+ Community Centres, 20+ Medical Centres, etc. etc., basically tonne of different sources.

So I would like the combo box, where I choose the person within a refSource that has referred a client, to only list people (or other staff personnel) that are affiliated with that source which I would have identifed one field earlier, rather than having a combo box that could potentially list hundreds and hundreds of names.

It's more complicated than just adding simple criteria in a query and making the combo-box look up that. The criteria must be dynamic; specific to each record.

Any insight?


Thanks,
Watson

I'm using Access2003 with WindowsXP. Thanks.

View Replies


ADVERTISEMENT

Dynamic Combo Boxes

Jul 31, 2006

I have a couple of combo boxes linked simply.

One is called brand and the other sub brand, and when i select a particular brand only the relevant sub brands are displayed. The problem i have is that when i reselect a different brand the sub brand combo box does not update.

I have created this setup by making the sub brand combo box a query.

The Query is:

SELECT SubBrand
FROM SubBrand.SubBrand
WHERE SubBrand.Brand=[Combo3]

Any help appreciated

Thanks in advance

View 5 Replies View Related

Dynamic Combo Boxes

Oct 27, 2006

I searched these forums but I did not see anything that was helpful in the matter, so if there is a thread like this please direct me to it and disregard this.

I have a combo box that houses the names of dealerships, this is bound to a table.

A user does have the ability to add a new dealership at all times to the combobox by simply typing it in.

The problem, the only way the new dealership appears in the list is if you close the form and reopen (which makes sense)

What I need to do is dynamically update this list so that anytime there is a new dealership it will automatically show up in the drop-down list.

Would a union query be the best way to go about this?

View 3 Replies View Related

Using Multiple Criteria From Combo Boxes

Oct 6, 2005

Hi All,

I would like a form (in Access 2000) that allows users to search the database using combo boxes that specify criteria. So, upon load the form would be populated by every record, then as the user begins to make selections using the combo boxes they can narrow the results down to only a few (combo box filters are cascading; each one narrowing the results the other returned). There would also obviously need to be a reset button and 'all' fields in the combo boxes. I have found the code to filter by 1 combo box but if more than 1 is added (obviously) the filter resets to filter only by the current selection. (See the method I used here (http://www.freevbcode.com/ShowCode.asp?ID=4668))

Does anyone know how to bolt these together so they work in sync?

Please be gentle as I've only been learning Access for 2 months and VBA is still very new to me

Thanks,

Bobadopolis

View 3 Replies View Related

Problem With Criteria In Queries Using Combo Boxes

Jul 20, 2007

Let me see if I can explain this.

I have two tables: TblValues and TblLOC.

TblValues is a table of stactic values where I have listed about nine field names with values under each that usually will not change. This way if there is a change to one of the fields later, I can just add it to the table.

Then there is tblLOC. Here I have similar field names that matches each field in tblValues where I can populate them in my form. I have several fields defined as combo boxes. In the properties for each field defined as a combo box, for row source type has Table/Query selected and for the row source I have the following code in the table, which is an example for the field named Profit Code in TblLOC.

SELECT tblValues.ID, tblValues.Pro1Code
FROM tblValues
WHERE (((tblValues.Pro1Code) Is Not Null));

Then I have my form where I have referenced my fields from the tblLOC. In the properties of each combo box, under the tab labeled DATA, the control source has the name of the the combo box field that is in tblLOC, in this case Profit Code.

Everything works fine. The user selects a value from the form and tblLOC is updated. I can create queries without criteria with no problem. However, in a query if I try to add any criteria, even as simple as using "like" to identify a value in a field of the table that has been populated by the combo box, I will get no results. However, if I use the same functionality in a column where a combo box is not used to populate the field, I get the results that I expect.

Here is an example of the SQL in the query that does not work for me that is applied against a field that is a combo box.

SELECT tblLettersOfCredit.[Profit Code]
FROM tblLettersOfCredit
WHERE (((tblLettersOfCredit.[Profit Code]) Like "Misc"));


If I use the same functionality with a field that is not populated by one of the combo boxes then everything works fine.

I am hoping that there's a simple solution for this, maybe syntax due to the use of a combo box or maybe a property that I need to set... So far I have been unsuccessful in finding the answer. If anyone has any ideas on this one, I would certainly appreciate it. Thanks :)

View 6 Replies View Related

Multiple Criteria Query Using Combo Boxes

Jan 28, 2008

Hi All,

I am currently having problems with a multiple criteria query with combo boxes (see attached file).

The problem:

- When user defines all 3 criteria (e.g. selects Project: A, Category: Services and Equipment Type: Packages), the query returns a result - no problem here.

- When user defines no fields (i.e. all combo boxes empty), query returns all records - again, not a probelm.

- However, say a user wants to display all records belonging to just Project: A, for example, the query returns no records. Obviously, there a a number of combinations of this (another example would be a user wanting to show records from project: B, with Category: Equipment Type).

I have included the Is Null statement in the query but to no avail. Could anyone advise on a solution based on the attached database. Your help would be greatly appreciated!

Kind regards,

Stephen

View 2 Replies View Related

Multiple Search Criteria With Combo Boxes

Dec 7, 2004

school has thrown me in to a bodemless ms access pit. can do a bit of VB but queries...I´m new to this stuff. i am glad to have found this fine forum.

i have:
-1 table: tblSpeler (65 entries)
-1 form: frmSpeler (already conected to a search query)
-1 search form: frmZoeken
*2 combo boxes: zoektekst (mp3 player make), zoektekst2 (mp3 player type), search button (cmdZoek).

my question:when i select a make, and then the type » i want that the form shows me the mp3 player with the selected make and type.

if more info needed, just ask. thanx

View 8 Replies View Related

2 Combo Boxes (2 Search Criteria) Won´t Work

Dec 12, 2004

i have a search form (see atachment1) with 2 combo boxes.
i have a pruduct form that runs on this query:

Code: SELECT * FROM tblSpeler WHERE (((tblSpeler.merk)=forms!frmZoeken!zoektekst1) And ((tblSpeler.type) Like forms!frmZoeken!zoektekst2));

if i start the the product form, it asks me for the make, and then for the player » it finds the right player in the form.
but via my search form it won´t work. it only opens the product form and no records are shown.

so: in the search form, when i select a "make", and then the "type", and then press search. i want it to show the right record in the product form.
+
when i select a make (eg "apple"), i want the type combo box to exclude all the types that are not from apple (eg only: ipod mini, ipod 20gb. right now it´s like in atachment2.

i know this is a common question, been trying to figure it out with a eg database, but i can´t get it done. all help is welcome

thanks,

-d

View 1 Replies View Related

DLookup Function Using Two Combo Boxes As Criteria

Oct 10, 2007

I have a form where I am using two combo boxes the second combo box fields are being based on what is selected from the first comb box. When I enter the DLookup criteria into the text box I am trying to lookup based on the selection of the combo boxes it returns nothing. Here is what my DLookup looks like:
DLookup("[BranchNumber]", "[tblAllADPCoCodes]", "[ADPCompany]= '" & [cboADPCompany] & "' And [LocationNumber]= '" & [cboLocationNo] & "'")

View 1 Replies View Related

Queries :: Multiple Combo Boxes In Single Query Criteria

Nov 20, 2013

I managed to get separate combo boxes to filter out results on a query, however now I have a slightly different problem.

I managed to get the combo boxes to filter records in different query criteria, i.e criteria A for field A, criteria B for field B, etc.

Now I would like to have several combo box filters in one criteria field, however no matter how much I try to move the code about, they either filter out nothing at all, or show up blank records as they're filtering one after the other, i.e filter for A, and then B, which clearly won't work as there will be no B if you've already filtered for A.

The code I'm using in each criteria box is;

Like "*" & [Forms]![MyForm]![Combo1] & "*"

and this works as a single criteria in a single field.

View 5 Replies View Related

Queries :: Criteria From Multiple Combo Boxes On User Form?

Sep 29, 2014

I have a user form with six different dropdown boxes. I would like to create a query that gets its criteria from users selecting values from one or more of these boxes.

I have tried:

[forms]![frmName]![comboboxname] or [forms]![formName]![comboboxname] is null

in the corresponding query fields and get a "query is too complex" error message, even when only selecting one criteria.

What am I doing wrong?

View 5 Replies View Related

Queries :: Setting Criteria For Query Based On 3 Combo Boxes

Jul 10, 2013

Ok so im working in MS Access 2007.

I want to create a query based on 3 combo boxes but have it so that if the field in the second or third combo box is not populated the query still runs.

Right now i have the Criteria set for the three columns that i wish to sort by as seen below.

Column 1
Criteria: [Forms]![Entity Selection Form]![areabox2]

Column 2
Criteria: [Forms]![Entity Selection Form]![devbox2]

Column 3
Criteria: [Forms]![Entity Selection Form]![entitybox2]

This gives me the correct query result but im forced to make a selection from each combo box. Is there a way to progamme it so that if I only make a selection from the first combobox and leave the others blank i can still get results in a query?

View 2 Replies View Related

Queries :: Query To Run Before Report Based On Criteria Based From Two Combo Boxes On Form

Mar 20, 2013

I have a report that gets its data from a query. I need the query to run before the report based on criteria based from two combo boxes on a form.

View 3 Replies View Related

Dynamic Query Criteria

Jun 14, 2006

Dear all,

I want to generate a different drop down box dependent upon the criteria of another selection on a form.

For example, when the user selects "fish" from the drop down, the query criteria lists only those animals whose animal type is fish. If the user selects "reptile" from the first drop down, the query criteria changes, so the next drop down box lists those animals whose animal type is reptile.

To summarise:

Choices in drop down 1:
Fish
Reptile

Choices in drop down 2:

If Drop down 1 = Fish
Cod
Haddock
Shark

If Drop down 1 = reptile
Snake
Lizard

Is this possible, and how do I go about structuring it.

Thanks,

Steve

View 1 Replies View Related

Dynamic Query Criteria

Jun 14, 2006

Dear all,

I want to generate a different drop down box dependent upon the criteria of another selection on a form.

For example, when the user selects "fish" from the drop down, the query criteria lists only those animals whose animal type is fish. If the user selects "reptile" from the first drop down, the query criteria changes, so the next drop down box lists those animals whose animal type is reptile.

To summarise:

Choices in drop down 1:
Fish
Reptile

Choices in drop down 2:

If Drop down 1 = Fish
Cod
Haddock
Shark

If Drop down 1 = reptile
Snake
Lizard

Is this possible, and how do I go about structuring it.

Thanks,

Steve

View 1 Replies View Related

Dynamic Query Criteria

Jun 14, 2006

Dear all,

I want to generate a different drop down box dependent upon the criteria of another selection on a form.

For example, when the user selects "fish" from the drop down, the query criteria lists only those animals whose animal type is fish. If the user selects "reptile" from the first drop down, the query criteria changes, so the next drop down box lists those animals whose animal type is reptile.

To summarise:

Choices in drop down 1:
Fish
Reptile

Choices in drop down 2:

If Drop down 1 = Fish
Cod
Haddock
Shark

If Drop down 1 = reptile
Snake
Lizard

Is this possible, and how do I go about structuring it.

Thanks,

Steve

View 1 Replies View Related

Dynamic Criteria In Query

Sep 13, 2007

Hello Access Expert

Is it possible to call a function as the criteria for a field in a query.

I have used a function that returns a boolean into the criteria field and it worked but when I create a string expression for the criteria field it doesn't seem to work.

For example I have created this simple function to generate a criteria


Public Function AcceptedDays() As Variant

Dim Days As String

Days = ""
If Forms![DrillDown]![Sunday] Then
Days = "1"
End If

If Forms![DrillDown]![Monday] Then
If Days = "" Then
Days = "2"
Else
Days = Days + " OR 2"
End If

End If

If Forms![DrillDown]![Tuesday] Then
If Days = "" Then
Days = "3"
Else
Days = Days + " OR 3"
End If
End If

If Forms![DrillDown]![Wednesday] Then
If Days = "" Then
Days = "4"
Else
Days = Days + " OR 4"
End If
End If

If Forms![DrillDown]![Thursday] Then
If Days = "" Then
Days = "5"
Else
Days = Days + " OR 5"
End If
End If

If Forms![DrillDown]![Friday] Then
If Days = "" Then
Days = "6"
Else
Days = Days + " OR 6"
End If
End If

If Forms![DrillDown]![Saturday] Then
If Days = "" Then
Days = "7"
Else
Days = Days + " OR 7"
End If
End If

AcceptedDays = Days

End Function



If however, I literarly type what the function produces into the query grid field the query generates the correct result. On the other hand if I send the result of the above function the query doesn't work. Any explanations ?

Thanks so much.

View 3 Replies View Related

Dynamic Multiple Criteria In A Single Field

Apr 5, 2007

I have a query that displays all records. I need it to limit based on multiple criteria in a single field. I.E... instead of all employees from every section, I just want it to display employees from section A, C, D, F one time and next time maybe go with section B, C, D. For some reason the solution eludes my little brain.

View 3 Replies View Related

Queries :: DSum With Dynamic Date Criteria

Jul 10, 2013

I need to do a DSum with criteria that picks up a previous month based on todays date, I have got the following but I don't know how to format the last part of the criteria.

If I take out the Month(DateAdd("m",-13,(Date()))) and replace it with 6 it works fine.

Code:
DSum("[invquan]","[qrySalesByStockCode]","[stcode] = '" & [stockcode] & "' and [Month] = Month(DateAdd("m",-13,(Date())))'")

View 1 Replies View Related

General :: Auto Populated Text Boxes To Display Rows From Combo Boxes

Jan 25, 2015

I have strange issue when creating auto populated text boxes which displays rows from combo boxes.

In one database auto populates works with simple text box Control Source edit "=[ComboName].[Column](NumberOfColumn)".

Somehow same method doesn't wotk in different database: here one time I have to insert VBA code at On change Event:

Me.TextBoxName = Me.ComboName.Column(NumberOfColumn)

And other time it wont work with On change but only with After Update Event (code is same).

Another thing this morning happens was that when I tried to add new record trough form where combo box and tex boxes are located, MS Office suddenly stopped working after selecting combo box selection (with message Microsoft Office has Stopped Working). It is 2013 version.

I got it work after deleting and re-inserting VBA code to autopopulate text box at After Update Event.

View 3 Replies View Related

Forms :: Database With 3 Tables - Linking Combo Boxes And Text Boxes

Jul 29, 2015

I currently have 3 tables within a database with student details of three different classes. I need to create a user form that has a dropdown box which I can select a student from one of these tables with a number of text boxes below which brings up all the students details, then once the student has been selected and the correct details are shown then I need to create a button which allows me to move that student from one table to another.

View 4 Replies View Related

Queries :: Multiple Combo Boxes And Text Boxes On A Search Form

Mar 24, 2014

I'm trying to build an database for aircraft operators. I've got the basic tables structure and relationships but I'm stuck on building an search form to filter records by user input.I've got following controls on my form (unbound):

1. AircraftType (combo box) from tblAircrafts
2. CompanyName (combo box) from tblListOfAircraftsOperators
3. TeailNumber (text box) from tblAircraftOperators
4. AirportNameSearch (combo box) from tblAirports
5. PassengersNumber (text box) from tblAircraftOperators
6. ManufactureYear (text box) from tblAircraftOperators
7. SourceSearch (combo box) from tblInfoSource
8. CountrySearch (combo box) from tblCountry
9. CategorySearch (combo box) from tblAircraftCategory
10. EamilToOperator (text box) from tblAircraftOperators
11. InteriorPhoto (Bound object frame) from tblAircraftOperators
12. ExteriorPhot (bound object frame) from AircraftOperators

I need to enable users to search for aircrafts based on those criteria. As I mentioned I'm new to Access and I don't have any advanced coding skills. I have a query build to perform the search and this is the code I've managed to write so far:

SELECT AircraftOperators.RegistrationNumber, AircraftOperators.PassengersNumber, AircraftOperators.ManufactureYear, AircraftOperators.EmailToOperator, AircraftOperators.ExteriorPhoto, AircraftOperators.InteriorPhoto, tblListOfAircraftOperators.OpratorName, tblAircrafts.AircraftType
FROM tblAircrafts INNER JOIN (tblAirports INNER JOIN (AircraftOperators INNER JOIN tblListOfAircraftOperators ON AircraftOperators.CompanyName =

[code]....

View 2 Replies View Related

Queries :: Query By Form With Check Boxes / Combo Boxes Not Working

Mar 25, 2013

Attached I have a database that I've been working on which has a form called "frmCriteriaSearch". It is based off of the qryCriteriaListBoxUpdate query. I am trying to get the listbox in the second tab of the results section to work. It queries fine for the checkboxes, but I cannot get the comboboxes to affect the query (unless a checkbox has already been selected)

View 6 Replies View Related

Forms :: Changing Multiple Text Boxes To Combo Boxes?

Mar 14, 2014

there is a way to convert multiple text boxes to combo boxes all at once, rather than right clicking on them one at a time, and selecting Change to.

I have a form with about 50 fields and most of them need to be converted to combo boxes. I'd always done it manually one at a time up to this point, but I'm trying to build up my learning and look for smarter ways to do things.

View 4 Replies View Related

Forms :: Search Form Using Both Combo Boxes And Check Boxes

Jun 5, 2014

I am trying to make a search option in my form header. Right now I have two unbound combo boxes (CboAccountsfilter and cboCourseName) that I can use to filter my records. Currently, I can use the drop down for CboAccountsfilter and a list of accounts will appear. When I select one, the corresponding Course Names will appear in cboCourseName. This works fine...Code below. I would like to take the filtering a step farther and add checkboxes to filter the data. I my form, there currently exist several check boxes (yes/no)...(Priority, Rep Top Target, Manager Top Target, ect). I would like to have the option to use a check box to filter. I.E if I had a checkbox in my header called PriorityFilter, if checked it would only bring up those records that met the two combo boxes criteria and was a priority.

Below is the code I have so far...it doesnt have anything for the checkbox because I am at a lost of how to get started.

Private Sub CboAccountsfilter_Change()
Me.Requery
Me.cboCourseName.Requery
Me.Check178.Requery
End Sub

[code]...

View 1 Replies View Related

Combo Recordsource (dynamic)

Mar 2, 2005

Hello,

I have a combo box that i would like to dynamically change the recordsource (what values are available in the dropdown) based off of the criteria in another field. Basically, I want to switch which query the combo points to.

I am looking to do something like...

If field1 = nulll
combo recordsource = query1 (a list of values from table1)
Else
combo recordsource = quer2 (a list of values from table2)


I am looking to switch which query the combo is populated with, not limit the rows based on field1.

Any Ideas for this? Thanks!

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved