Access query combo box source based on individual record - ms-access

my database has MachineT, ProductT and ProductionT.
each product can be made only in some specific machines (multivalue field).
when planning production I need the dropdown menu to show only the possible machines for that product in a form containing a datasheet view.
In the actual database the ProductionF has a data picker and the subform is based on ProductionQ only for that day and it is important to keep the datasheet view because the planner is adding dozens of records in one sitting.
thank you
*edit - I tried to force the field in ProductionT via lookup but it does not filter for each record.

[If you only have 4 machines], what if in ProductT, rather than just one Machine ID, you have fields M1,M2,M3,M4 as a Yes/No (checkbox) selection, then you can make your combo box where fields = True
or maybe this link can help you http://allenbrowne.com/func-concat.html
Edit
What if you have a new table called something like "Product_machine_combo" and this is where you can combine the relationship between the product and the machine used. You could use a list box that lists the Products and have a ListBox for the machines (kind of shown below; link to this resource: https://www.iaccessworld.com/add-items-textbox-listbox/). I just don't know how it would show up in the table. Or you could add a list box to the product form itself?

Related

Display information about an item based on dropdown in InfoPath

In InfoPath, I would like to display information about an item based on a dropdown selection.
I have a table that contains data about computer systems. I would like some of that information to be displayed in InfoPath based on what is chosen in the dropdown. The dropdown is based on the site the computer system is located and I would like to display the IP Address, the computer name, the Address of the site, the type of device it is.
Is this possible?
Never used InfoPath so not sure. On a normal Access form, this can be accomplished several ways.
multi-column combobox has the related info and textboxes reference columns of combobox
include the related table in form RecordSource but prevent edit of the lookup table data by locking the textboxes
DLookup()
Any of those transferrable to InfoPath?

Access 2016 drop-down list appearing in Reports and Queries

In Access 2016 I have a table called 'Orders'.
I also have a Form (also called 'Orders') that we use to enter order information. On the form, one field in particular ('Company') is a drop-down list. The control source is a second table called 'Companies'. And the Row Source is a SQL Query:
SELECT [Companies].[ID], [Companies].[CompanyName] FROM Companies ORDER BY [CompanyName];
So, when the user is entering an order into the Form, he/she can select the company name from this drop-down list and it in turn updates the Orders table. All basic stuff, and it works fine.
Next, I created a query (also called 'Orders') and it is based off of the Orders table.
When I run the query in Access and view it as a Datasheet, I was surprised to notice that the Company field (IN THE QUERY datasheet) is a drop-down list. Not only that, it even lets me change the value - right here in the query! If I view the SQL for this query, I can see that it is a SELECT query. In my mind, a SELECT query is read only. So my questions are - What's a drop-down list doing in a Query, and WHY does Access let me edit the values directly in the query? Isn't this supposed to be read only?
Next question:
After verifying that all of the data I need is in the Orders query, I then created a report (called 'All Orders') and the control source for this report is the Orders query. (not the table).
When I view the Report in Design view, there's the drop-down list again. Why? I am just looking to add the Company name that the user selected when they completed the form. I realize that the form Control for entering that data (on the FORM) is a drop-down list. But here I am building a report and I just want the VALUE to appear here. Not the drop down control? (I know that when I print the report or view it on the screen, the drop-down boxes go away and all I see is the actual text). But my question is - WHY is Access showing me a drop-down list control on a report? and in a select query? The query and the report are no place for editing data. I just want the value that was selected.
That's because you've defined the lookup list in the table. If you do so, it propagates to queries and new reports and forms, and will be the default way to view the data everywhere you've placed it.
Open your table in design view, and change the display control for your field back to text box. Note that any forms and reports will need to be edited or recreated, for queries the change should propagate.

How do I make a query run based off a selection in a ListBox in Access?

I have a DB created with information in a few tables.
In the table I have a category in one of the columns labeled as "Supplier"
On the main form of the DB I have a listbox that has all of the suppliers that are in the table. When I click on the supplier name it generates all of the Part Numbers in a separate listbox below. I want to be able to click on the Part Number and then click a button and then it will bring up all the information in the table or all fields in the table based off of the selected part number from that listbox.
Please look at the samples from the link below.
http://www.fontstuff.com/access/acctut18.htm
Martin has lots of good stuff here as well!!
http://www.fontstuff.com/access/index.htm

Best way to create a form that changes and gets information from multiple tables and queries

I've been pondering this for a couple of days now, i have a relatively large database with multiple tables, and my goal is to be able to administrate this with a MS-Access application. This is the workflow that i want to achieve:
1. Choose a category of products
2. Choose a specific price list.
3. This lists all products of that category in this price list.
4. Choose an item in the list a
5. this triggers an update in a subform and fetches the data related to the choosen row
6. Choose the price in the subform for that specific type.
This problem triggers some newbie questions:
1. How do i trigger an update in a datasheet from a drop down list, so that the datasheet only fetches products related to that category?
2. How do i make a subform trigger yet another subform to update?
And third but not least
3. Is there any good tutorials or other study material out there?
If theres anything that is unclear please tell me and i will try to clarify the questions, english is not my native language. :)
Access will do a lot without any code at all. For example, if your categories are listed in a listbox, that can be made to cascade to a second list box that shows only relevant price lists. Subforms have link child and link master fields that can refer to fields (columns) or controls. You can have a subset of records in the subform where the link master field(s) are the listbox(es) and the link child field(s) are the relevant related field(s). You can also refer to subform controls in link child and master fields.
You might like to look at the Northwind sample database that ships with all versions of Access, in particular, the Customer Order form.

Selecting a record in Access Subform

I have a form in Access 2003 that contains 2 subforms. The first is in datasheet view and is only 2 fields, SiteID and SiteName, so a list of many sites for one record in the parent form. The second subform is the same datasource as the first, but in single form view, so it shows all the site fields for one site in a single form. The idea being that I have a list of the site names on the left and I want to then click on one and have its OnCurrent event filter the subform on the right to show all the fields in that record (for that site).
This seems like a fairly simple thing to do but I can't figure out what code (docmd.gotorecord?, filter?, programatically change the subforms query and then requery etc) is the best to use... and how to make it actually work.
Any help appreciated.
Have a look at the Customer Orders form in the Northwind sample database (NWind.mdb) that ships with every version of Access or can be downloaded http://www.microsoft.com/downloads/details.aspx?familyid=c6661372-8dbe-422b-8676-c632d66c529c&displaylang=en
I think you will find it does what you want.