Run query based on value in combobox
Each query will be a parameter query, the parameter values being provided by text boxes on the form.
I was thinking that I could add a column to the Elements table to hold the name of the query associated with each element.
I am not sure how to retrieve both columns from the Elements table into the combobox so that the query could be executed by clicking on a button on the form
Thank you for taking the time to report an issue.
What's wrong... Please write below.
Currently, I referring to the combobox control as [Forms]![Proposal]![Tests subform]![cbotestm], which works when you run the query separate from the form, but doesn't when the query is run through the combobox row source. I have seemingly tried every other syntax I can locate for the control name, e.g. [forms]![Proposal].[form]![Tests subform]![cbotestm], none of which seem to work.
My problem with this comes when I press the button and I get a message box titled "Enter Parameter Value" with my field reference line Forms!subFrmName!cboName with a text box underneath.
Am I doing something wrong? I've checked the subform name and combobox name multiple times and it appears that I'm referencing them correctly.
For instance, if I want to search my data for serial numbers my query will chose the serial field if that's what the combo box is set for and then ask for an input to search against that field.
Right now I have the combobox displaying my fields, but I cannot get a query to work based on the content of the combobox
The data has to come from 2 different tables. I assume I have to create a query based on the data I want from each table. How do I link the combobox selection to the query criteria: so thatit only returns the data for that job number and once that is done how do I get it to display in the form textboxes.I know how to get the combobox to populate the textboxes with data fromone table.
I know you can do it based on the combobox selection but that is not what I want. I have the user make a selection from the combobox and store it as a variable under the afterupdate event criteria. Within that same afterupdate event, I want to close the form and run a macro that will allow the user to select a file using the API command dialog box.
I have the command dialog box macro runnig fine and can call it from a button with no problem. Just need to be able to call it from within a combo box.
INSERT INTO tblSubTeamEvent ( SubTeamID, EventID )
VALUES (Me!SubFormSubTeamForm.Form!cmboSubTeamSF, [Forms]![frmEvent]![EventID]);
but when I run it it asks for the parameter value of the cmboSubTeamSF. If I just ignore the question it still updates the EventID into the table but obviously not the SubTeamID. I've tried various combinations of Me! Forms! etc but can't get it to work any ideas any one
Table Size: rows with different sizes
Table Type: rows with different types
Table Type_Size: rows showing which Sizes/Types combinations are permitted.
Thus Type 1 might be available in Size S and M, but Type 2 might only be available in Size L.
I have set up a form (I.e. for purchases) that allows a user to choose a Type from a combobox (easy query to fill the combobox). There is also a Size combobox with a simple query that addsan additional WHERE clause to only show Sizes for the specific Type selected in combobox #1 (based on the allowed combinations listed in Type_Size).
I requery combobox #2 based on two events: change in combobox #1, or change in current record. As a form this works beautifully! I can only choose Sizes appropriate to each Type. Exactly what I want.
Now I want to convert said form to a Datasheet. The query for the combobox #2 is the same across all rows of the Datasheet. In fact the results are pretty funny. If I have say 10 rows already displayed in the Datasheet and I select a row that has an item of Type 1, then all the rows with items Type 1 will list the size that was selected for that entry (since the querybecomes valid).
All the other rows will not show a size -- unless that size happens to also be available for Type 1.
Have three comboboxes
1) Products Category
1. Select the category from the first combobox,
If the category is not available update the category table by enterting the category in the combobox
2. Based on the selection of the category combobox the products will be displayed in the products combobox.
Again if the product is not available update the products table
3. Based on the products combobox the packing will be displayed in the third combobox.
I was able to get the data in the second combobox based on the selection in the first combobox. But not going to the third one. Also to add a new item if not available.