I haven't found an answer to suit my needs yet. How do I populate multiple tables using a single form? - ms-access

I have a main table that is populated by a single form. This table has all of my customer info and lists all of the products we sell with the amount sold of each product to each customer. I am creating seperate tables for each individual product. I would like to know how to make this single form populate a row in the table for each individual product if the amount sold to a single customer is at least 1.
For example, say I'm selling widget_1, widget_2, and widget_3. On my main table, the customer info will be populated no matter what. Now, I have one table for widget_1,one table for widget_2, and one table for widget_3. If a customer orders only a #1 and a #3, I want their info to be input into the tables for widget_1 and widget_3, but not widget_2.
How would I do this?

Is there any reason why you cannot have a subform for widgets 1 to 3, if only a limited number of widgets are available? The main form does not have to be bound, the link master fields can be set to controls matched to the relevant subform fields, so that the data is automatically populated to the widget table when a quantity is entered into the relevant subform.

Related

Create product form that allows selection of any item with MS Access

The following is a simplified version of my problem:
We have a product table containing all items available in a store. The customer should always see all products available for purchase. The items the user selects should be associated with his invoice record. I have modeled the relationship as follows:
tbl_Product <-1---m-> tbl_ProductInvoice <-m----1-> tbl_Invoice
How can I create a form that opens up to all products being available for selection. The solution "must" allow the customer to use a checkbox per product to make the selection. Listboxes are not allowed.
My solution to this problem is to have a bound invoice form with an bound product subform. When a new invoice is created, all possible product combinations are created, with the checkbox being set to false, so that the subform shows the products. What would be a more efficient way of doing this?

Access: selecting multiple values in a multiselect listbox based on a previous selected value

Sorry if this is a question which is ask many times, but im new to access and have no idea how this matter is called.
In Access I have 3 tables. The first one is Projects
Table Projects has many columns, one of them is Project_Name.
Second table is WBS
Table WBS has also many columns, one of them is WBS_Name and other is Project (which is a dropdown based on Project_Name from table 1).
Sample:
WBS table sample
The third is Orders, here is where im stuck.
Table Orders has a column called Order_Name, also in this table I have a column called Project (which is also based on Project_Name from table 1. The last column (WBS_Product) is a multiselect listbox with values from WBS_Name from table 2.
Order table sample
Now in this third table I want to see in the WBS_Product row only the values available for selection based on the Project selected in the second column.
You REALLY should be using forms if you want to customize your data entry like this. Because you're entering data directly into the tables, I don't believe this is possible.

MS Access - Customized Price List

In MS Access, I've got Table A that lists products with the price for each product and Table B with Customer Name, Customer ID and the Profit Margin associated for each customer.
What I need to do is create a customized price list for each customer based on their profit margin. Each customer will receive the exact same list of products from Table A. The only difference being that the price column in Table A will change depending on the Profit Margin column contained in Table B.
Ultimately, I would use this to create a report that would then be emailed out to each customer.
I’m having some difficulty figuring out how to set it up so that all customers in Table A are linked to one price list with differing prices depending on their profit margin.
If anyone could help give me a push in the right direction I would greatly appreciate it.
Thank you
I'm assuming you have the following tables:
tblProducts, with fields Product and Cost.
tblCustomers, with fields Customer and Margin.
I'm not sure how your margin works (is it a factor which is multiplied by the cost, or a fixed amount which is added on?), but the formula should be easy to work out to suit your needs.
Create a query. In query design mode, show the two tables. Add the field tblProducts.Product to your query, and the expression [tblProducts].[Cost] * [tblCustomers].[Margin].
In the Criteria for this expression, you can set, for example, [tblCustomers].[Customer] = "John". Or, instead of specifying a particular customer, you could reference a control on a form. In this way, changing the control on the form (eg. selecting a customer from a listbox) will change which customer's data the query is based on.
Then you can build a query on the report as usual.

Access 2010 - display related record in a form

I have 2 related tables.
Invoice (fields: number, buyer, supplier, etc.)
Company - all buyers and suppliers (fields: name,etc.)
Buyer ans supplier fields on invoice are referencing same field (company_id from company table)
On invoice form, I choose supplier ID from dropdown list and also buyer ID from dropdown list.
Task: To make the form little bit readable, I would like to automatically display a name of company after selecting company id in both fields.
What I did:
I manually dragged the company name field to the form and wizard asked me which field I would like it to connect to (byuer or supplier), so I got 1 field working. How to create another field that shows company name? If I drag another instance of company name, wizard does not show so I can set it up and I can not find anywhere setting for that. Thank you for help.
I think the best way is the following:
Create a lookup query: Create a new query similar to this “SELECT CompanyId, CompanyName FROM t_Companies ORDER BY CompanyName;” and save it as “ql_Companies”
Edit your Invoice table. For both your fields Buyer and Supplier do the following: Click on the field and select Lookup in the filed properties. Set the following properties: Change Display Control = Combo Box, Row Source = ql_Companies, Column Count = 2, Column Width = 0;5 and save the table.
Now when you create a new form based on your Invoice table the field will be automatically shown as a combobox.
You can also do all this manually on an existing form but then the combo box will only show on this one form. If you prepare the underlying table with lookup queries then this will work in all queries and forms automatically without additional work.

Query a table by value in main form and load subform - Access 2007

When I open Order Form, it should show the list of products already present in that order in a 'ProductsCartForm'
My tables are as below:
OrderTable:
OrderId - Autonumber
CustName
ShipAddress
Amount
ProductCartTable
ID - unique
OrderId - one orderId may hold many productIds
ProductId
Quantity
UnitCost
I want to create 'ProductCartForm' in my main form 'OrderForm'. I have a parametrised query 'qryProductsByOrderId'. If I create a subform based on qryProductsByOrderId, how can I pass the parameter 'orderId' to the subForm before/on Loading.
Some one pls help.
Thanks.
Like Roland says, no VBA necessary. This is what Access does well :)
Make your form for your Orders (necessary to have record source of OrderTable). Then make your form for your Products (doesn't need to be perfect, just needs to exist and have a record source of ProductCartTable). Save both. Close the Products form.
Go into your Orders form and drag your Products form on it. This will create the products form as a subform. It will likely populate the Master/Child links for you but if it does not you just need to write in OrderID for both because it is what joins the two record sets together.
This effectively does a left join for you. Only product records which are relevant to the order being shown will show on the subform.