Pass option box selection to combo box query criteria

I have an option box with options 1-4.
I have a combo box with data based on a query.
I would like to have the option box selection limit the selections on the 
combo box.
Any help is appreciated.
-- 
Teach me to fish!  Thanks for the help.
Pax, M
1
Utf
3/10/2010 6:00:10 PM
access.formscoding 7493 articles. 0 followers. Follow

6 Replies
1363 Views

Similar Articles

[PageSpeed] 29

Give a little more info her or an example of what you are trying to achieve 
then we might be able to assist you.

The way I read it now is that when you select 1 in the optionbox you want to 
have only one choice in the combobox. What's the source of the combobox?
-- 
Maurice Ausum


"m stroup" wrote:

> I have an option box with options 1-4.
> I have a combo box with data based on a query.
> I would like to have the option box selection limit the selections on the 
> combo box.
> Any help is appreciated.
> -- 
> Teach me to fish!  Thanks for the help.
> Pax, M
0
Utf
3/10/2010 6:55:02 PM
If I select option 1 - (say team 1), I want only members of team 1 to be 
displayed in the combo box.  The combo box is based on a query of all members 
from all teams and includes the member's names and the team.
-- 
Teach me to fish!  Thanks for the help.
Pax, M


"Maurice" wrote:

> Give a little more info her or an example of what you are trying to achieve 
> then we might be able to assist you.
> 
> The way I read it now is that when you select 1 in the optionbox you want to 
> have only one choice in the combobox. What's the source of the combobox?
> -- 
> Maurice Ausum
> 
> 
> "m stroup" wrote:
> 
> > I have an option box with options 1-4.
> > I have a combo box with data based on a query.
> > I would like to have the option box selection limit the selections on the 
> > combo box.
> > Any help is appreciated.
> > -- 
> > Teach me to fish!  Thanks for the help.
> > Pax, M
0
Utf
3/10/2010 7:55:01 PM
On Wed, 10 Mar 2010 10:00:10 -0800, m stroup
<mstroup@discussions.microsoft.com> wrote:

>I have an option box with options 1-4.
>I have a combo box with data based on a query.
>I would like to have the option box selection limit the selections on the 
>combo box.
>Any help is appreciated.

This is a minor variant on the FAQ "conditional combo boxes".

Change the combo box's Query to reference the option group as a criterion;
e.g. if you have four values of the GroupID field, use something like

=[Forms]![YourFormName]![YourOptionGroupName]

as a criterion on GroupID. You'll also need to Requery the combo box in the
AfterUpdate event of the Option Group control.
-- 

             John W. Vinson [MVP]
0
John
3/10/2010 9:55:08 PM
Ok, clear.

Your query is leading here. It should be paramatized based on the choice 
made in the optionbox.

In your query you have a field indicating if a player belongs to team 1. In 
that field in the query put in the criteriabox: "forms!formname!optionbox"

Now replace the 'formname' with the actual name of the form where the 
optionbox is placed on. After that rename the 'optionbox' part to the actual 
name of the optionbox which you have placed on the form.

Now the last part you have to do is to requery the combo when a choice is 
made.
Go to designview of our form and click the properties of the optionbox. Look 
for the afterupdate event and choose the ... to create an event.

In the after_update event place the following line between the sub and end 
sub:

me.combobox.requery

rename the 'combobox' for the actual name of your combobox.

One final remark... the optionbox returns a numerical value. So the field in 
the query should be a numerical field otherwise the combo will not return any 
records.

hth



-- 
Maurice Ausum


"m stroup" wrote:

> If I select option 1 - (say team 1), I want only members of team 1 to be 
> displayed in the combo box.  The combo box is based on a query of all members 
> from all teams and includes the member's names and the team.
> -- 
> Teach me to fish!  Thanks for the help.
> Pax, M
> 
> 
> "Maurice" wrote:
> 
> > Give a little more info her or an example of what you are trying to achieve 
> > then we might be able to assist you.
> > 
> > The way I read it now is that when you select 1 in the optionbox you want to 
> > have only one choice in the combobox. What's the source of the combobox?
> > -- 
> > Maurice Ausum
> > 
> > 
> > "m stroup" wrote:
> > 
> > > I have an option box with options 1-4.
> > > I have a combo box with data based on a query.
> > > I would like to have the option box selection limit the selections on the 
> > > combo box.
> > > Any help is appreciated.
> > > -- 
> > > Teach me to fish!  Thanks for the help.
> > > Pax, M
0
Utf
3/10/2010 10:21:01 PM
Works like a charm!  Thanks Maurice1
-- 
Teach me to fish!  Thanks for the help.
Pax, M


"Maurice" wrote:

> Ok, clear.
> 
> Your query is leading here. It should be paramatized based on the choice 
> made in the optionbox.
> 
> In your query you have a field indicating if a player belongs to team 1. In 
> that field in the query put in the criteriabox: "forms!formname!optionbox"
> 
> Now replace the 'formname' with the actual name of the form where the 
> optionbox is placed on. After that rename the 'optionbox' part to the actual 
> name of the optionbox which you have placed on the form.
> 
> Now the last part you have to do is to requery the combo when a choice is 
> made.
> Go to designview of our form and click the properties of the optionbox. Look 
> for the afterupdate event and choose the ... to create an event.
> 
> In the after_update event place the following line between the sub and end 
> sub:
> 
> me.combobox.requery
> 
> rename the 'combobox' for the actual name of your combobox.
> 
> One final remark... the optionbox returns a numerical value. So the field in 
> the query should be a numerical field otherwise the combo will not return any 
> records.
> 
> hth
> 
> 
> 
> -- 
> Maurice Ausum
> 
> 
> "m stroup" wrote:
> 
> > If I select option 1 - (say team 1), I want only members of team 1 to be 
> > displayed in the combo box.  The combo box is based on a query of all members 
> > from all teams and includes the member's names and the team.
> > -- 
> > Teach me to fish!  Thanks for the help.
> > Pax, M
> > 
> > 
> > "Maurice" wrote:
> > 
> > > Give a little more info her or an example of what you are trying to achieve 
> > > then we might be able to assist you.
> > > 
> > > The way I read it now is that when you select 1 in the optionbox you want to 
> > > have only one choice in the combobox. What's the source of the combobox?
> > > -- 
> > > Maurice Ausum
> > > 
> > > 
> > > "m stroup" wrote:
> > > 
> > > > I have an option box with options 1-4.
> > > > I have a combo box with data based on a query.
> > > > I would like to have the option box selection limit the selections on the 
> > > > combo box.
> > > > Any help is appreciated.
> > > > -- 
> > > > Teach me to fish!  Thanks for the help.
> > > > Pax, M
0
Utf
3/11/2010 8:54:01 PM
Thanks John!  As above, this works great.


-- 
Teach me to fish!  Thanks for the help.
Pax, M


"John W. Vinson" wrote:

> On Wed, 10 Mar 2010 10:00:10 -0800, m stroup
> <mstroup@discussions.microsoft.com> wrote:
> 
> >I have an option box with options 1-4.
> >I have a combo box with data based on a query.
> >I would like to have the option box selection limit the selections on the 
> >combo box.
> >Any help is appreciated.
> 
> This is a minor variant on the FAQ "conditional combo boxes".
> 
> Change the combo box's Query to reference the option group as a criterion;
> e.g. if you have four values of the GroupID field, use something like
> 
> =[Forms]![YourFormName]![YourOptionGroupName]
> 
> as a criterion on GroupID. You'll also need to Requery the combo box in the
> AfterUpdate event of the Option Group control.
> -- 
> 
>              John W. Vinson [MVP]
> .
> 
0
Utf
3/11/2010 8:55:01 PM
Reply:

Similar Artilces:

Is It Possible To Pass Parameters to A Pass Through Query
My assumption is that's it's not. At work I use ODBC to connect to our oracle database with Access 2003. There are cases where using a pass through query runs much much faster and I then use it in a make table query to make a local table. In access you can use brackets [] to have it ask for input. May I assume there is no way to do anything like that in a pass through query? Create a PassThrough query and use code to assign the SQL to this query filtering it with a parameter, and then run it e.g Dim MyVariable As Integer MyVariable = InputBox("Please select a Number&quo...

Updating Links Option
When I get the message "This workbook contains links to other data sources" I can't imagine what "other data" they are referring to. How can I find out the source of this "other data" Thanks in advance Dave When I can't find links, I'll use Bill Manville's FindLink program: http://www.oaltd.co.uk/MVP/Default.htm It does a much better job searching for them than I can do. Dave wrote: > > When I get the message "This workbook contains links to other data sources" > I can't imagine what "other data" they are...

pop up combo box
Hi everyone, When we write a class name in VC++ and type dot(.) then a combo box comes with a list of its members.I want to implement this feature in an edit box.How can I do this? Any help/example/link ??? _____mamnun Thats called intellisense. Look at codeguru/codeproject to see if you can find some sample code. It shouldnt be that hard to implement. Essentially all you are doing is showing/hiding a window with custom content. --- Ajay I know this is not exactly what you want, but it might also be a good starting point http://www.codeproject.com/editctrl/smart_auto_completeasp.asp A...

'Email via Mail Merge' option missing -again, please, help
No 'Mail Merge' options (email, Letter) in the Create Quick Campaign Wizard are there. I am using the Outlook client, the option 'Enable Direct E-mail via Mail Merge' is selected in System settings, approptiate roles are assigned. Outlook and web client use differenet URL, they are not running at the same time (just Outlook is running). I deleted all cookies and closed all Explorer windows - nothing helps :-(( Is your Outlook and Word the same release? ie. You have both Outlook 2003 and Word 2003? "zen" wrote: > No 'Mail Merge' options (email, L...

Pass multiple selected values from list box to table
How do I pass multiple selected values from a list box to a table? I've found code to use the values as criteria in a query but would now like to store the values in a table (at least temporarily) thanks in advance. jack Pass selected values from a list box to a table? I don't really think you want to do this. Can you describe more about what you are trying to accomplish? You just store raw data in a table. You don't store manipulated data in a table. Maybe you need a query to do what you want to do... -- Ryan--- If this information was helpful, please indi...

Flexibility in Line Item options
Hello, I am preparing a construction budget for some condos and I'd like to have a simple way to choose between different options for some of the line items (i.e. granite countertops instead of tile)... each would have its own cost implication and affect the bottom line. Any ideas? Thanks, Kalvin Mizzi Financial Analyst Equity Directions, Inc. Hi Kalvin If you make a data array with options and price as: Data array: Granite 3 Wood 4 Tile 5 You could use a validation list on the first column to make a dropdown menu and then a VLOOKUP() on the table array to change the price on the bo...

text box won't align middle
I've got a text box in one of my documents, i've set it to middle align (they all are), but this one doesn't - it looks to me like its top align... It's got a texture background (the same as the others), and the text is arial embossed... I've tried setting the margins to 0 and 0.1 (and whatever they were as a default)... Select the text box, Format, Paragraph, be certain all these settings are correct. Zero before and after. Could be the text box has some corruption going on. If you create a new box and paste the text into it, does it work? -- Mary Sauer MSFT MV...

How to pass an object from C++
Hello! We have a C# asp.net web application that is using a COM dll We use the tlbimp to be able to use the COM dll from C# asp.net web application The method InitRules shown below is located in the COM dll. It can be seen below the text Original. Method InitRules below is called from C# but we want to pass an object of type Handle_DS in addition to all the other parameters. You can see the modified InitRules below marked Modified Note the object of type Handle_DS is a C++ object that is created from C# asp.net application and pass into the InitRules I have also copied the whole idl fil...

Send options for one receipent
I'd like to set one email receipent's send options to be different from others. When I start an email for this user I can go into options and set it's priority, a different reply address, etc. I want this to be the same for the receipent all the time. Is there away I can set a default for this? Hi M.Siler, TOOLS | EMAIL ACCOUNTS | View or change existing Accounts | There you can change the default account. Is this what you asking for? -- Ich habe nichts gemacht, gestern gings noch! Bitte in den Newsgroup antworten damit jeder etwas davon hat. Bravestar@Datenschutzministerium.de...

Is this possible from combi box
Hi Using a drop-down box (Combi Box), i want to be able to select an item from a list e.g 'Chocolate Bar' then in another combi box, display that item's cost automatically. ------------------ ------------------------- Chocolate Bar �0.50 ------------------ ------------------------- Thanks in advance Paul Paul, If you have a couple of worksheet ranges, one with the items, a second with the prices, you can load the items combobox from that first list and you can use the Listindex property of the combobox to offset int...

groupmethod options
When designing reports (.qrp files), what can you set GroupMethod to besides groupmethodNone or groupmethodSum? Thanks, Mike FDA ...

check box #7
Hello Is it possible to have a x when the checkbox is on and not a "v" I use Excel 2003 thanks You may want to rephrase this question. (I'm confused by what you mean and maybe others are, too.) starfighter61 wrote: > > Hello > Is it possible to have a x when the checkbox is on and not a "v" > > I use Excel 2003 > > thanks -- Dave Peterson ...

date diff expression in query
I am trying to calculate the difference between two dates 'End Date' and 'Date of Visit' using a query. This is the expression I used: TimeFrame:[Date of Visit] - [End Date]. However, 'End Date' is present in both tables I have used to create this query 'tbl_NewInfo' and 'tbl_Foloowup'. I want the 'End Date' from 'tbl_NewInfo'. How do i specify this in the expression and thereby prevent the error msg I am getting? Thankyou You must fully qualify the field name like: [Table Name].[Field Name] I use a naming convention that resu...

100% Passing Guaranteed in All I.T. Exams/Certifications at 1st Attempt Hi Friends, To pass all types of I.T Exams/Certifications with mind blowing results in 1st attempt just visit http://www.itreal
100% Passing Guaranteed in All I.T. Exams/Certifications at 1st Attempt Hi Friends, To pass all types of I.T Exams/Certifications with mind blowing results in 1st attempt just visit http://www.itrealexams.com/ and get real time Q&As, Brain Dumps, Real Exams, Study material, E-Books, Video Exams and Labs for your all type of I.T Certification Exams. ...

PDF option
I have acrobat reader 6.0 loaded on my machine. However, I do not get pdf as one of the options in my reports printing file type. I am on Great Plains 8.0 You need the full Adobe to write files. Just the _reader_ won't work. Of course I expect a great many to reply to this as well and tell you there are some free and other inexpensive PDF writers out there but only Adobe will work as you are expecting it here. <anonymous@discussions.microsoft.com> wrote in message news:22a101c49a91$f3dc4110$a301280a@phx.gbl... > I have acrobat reader 6.0 loaded on my machine. However, I &...

IT CertificationzzzZ.....100% GUARANTEED PASS.......!!!@!!!
IT CertificationzzzZ.....100% GUARANTEED PASS.......!!!@!!! Hi guys, If you are serious about your professional career and pass IT Certification exam in first attempt then Visit http://www.FreeExamKing.com and get latest Questions And Answers Dumps for Microsoft, Oracle, Cisco, CompTIA and many more, i have used and found it very helpful. ...

Passing data between forms
Hi I am working on a project someone else started, and he has this code: If STR_FormName = "FMS_ToDo" Then Page47.SetFocus He obviously expects the name of the last form to be here, but it is not. In fact, when I put Option Explicit at the top - this field was undefined. How is this supposed to work? Stapes ...

Passing arguments to procedures
There is something fundamental that I have failed to grasp about passing arguments to procedures. I have a form featuring a set of unbound controls displaying dates and the corresponding days of the week. (For some reason, the long-date format, on my computer, does not include the latter, as the documentation suggests it might, so it has to be separately calculated and displayed.) A default date is displayed in each control, on Form_Open. This can then be manually adjusted by a pair of ‘up’ and ‘down’ buttons associated with each day/date control pair. In the case of the control ‘St...

Query engine for MS Dynamics CRM 3.0
Hi, exist in MS CRM 3.0 a query engine tools so one user can produce an excel export os some data? For example: I need all account address based on a category? I need all contact contacted for a specific campaign? and so on Thanks and sorry form my bad english Lorenzo Soncini Technoservice S.a.s. 38057 Pergine Valsugana (TN) Italy You can do this using Advanced Find. Click advanced find on the toolbar in the main crm window. Select the entity to search on (Look for field) Edit the query (big white area) Edit the columns to showup (Edit columns button on the top toolbar) Click FInd Click ...

Delivery options
I'm familiar with using the "alternate recipient" in the Delivery Options to get a copy of all received emails for a particular exchange account. We have a need to monitor outgoing e-mail for a small group of users and wanted to know if there is a similar function as the "alternate recipient" on income email? We would like to avoid using keyboard buffers since they would probably be detected in time with our anti-virus software. What version of Exchange? -- Mark Fugatt Microsoft Exchange MVP www.exchangetrainer.com www.msexchange.org "Admin" <...

Office 2003 SP3
Ever since installing SP3, we have problems in Access with combo boxes being blank. What is the hotfix for this and how do I get it? If I recall, you need to go to the underlying fields in the tables and remove the Formatting there. If you want the values formatted, apply it in your forms/reports. Good luck! Regards Jeff Boyce Microsoft Office/Access MVP "Suew" <Suew@discussions.microsoft.com> wrote in message news:E30380C6-3D69-4012-B7DD-1668ED381CB3@microsoft.com... > Ever since installing SP3, we have problems in Access with combo boxes > being > blank. ...

Update Query Randomization
I'm now trying to update some of the data in a table with UPDATE rawdata SET rawdata.[User] = Int((1200-1+1)*Rnd()+1); but it updates all the values to a single random number. Is there a way to make it insert a different random number for each value? The key is called ID Test if this will work: UPDATE rawdata SET rawdata.[User] = Int((1200-1+1)*Rnd()+[USER]); -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "Ian" wrote: > I'm now trying to update some of the data in a table with > ...

dialog box running in a thread? why???
hi, i've just started working on this application, and i found that dialog box is made to run in another thread. actual scenario is like this : void CMyView::OnLButtonDown() { CMyDlg dlg; dlg.DoModal(); //overridden; see implementation in next function } CMyDlg::DoModal() { < create thread here thru AfxBeginThread, passing this pointer in LPARAM > // see // thread implementation in next function HANDLE h[1]; h[0] = pThread->m_hThread; while( true ) { MSG msg; while( PeekMessage( &...

Menu Item Options -> Formulas Disabled for Pivot tables.
I am using Excel 2007 with SQL Server Analysis Services 2008. I want to create calculated measure based on other measures, but I cannot do this for Pivot table. If I go to menu "Options"->"Formulas" I can see that it is disabled. Can anyone let me know how to enable the "Formulas" in Options for Pivot table. Thanks Hi As far as I am aware, there is no method of using Formulas in a PT, when the source is based upon an OLAP cube. -- Regards Roger Govier "Ruchit Shah" <ruchit_shah@persistent.co.in> wrote in message news:uIHflZJ1JHA.143...

Emailing a form created from a query
I am using Microsft Access 2007 to email a form to individual email addresses so they can update their details and email it back to me. The form was created from a query as the information is in more than one table. However when the recipient gets the email the form is blank and no longer contains the information which was in the form and query. It seems to work when I have created the form from a table but not a query??? ...