473,473 Members | 2,151 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Form in Form != Subform?

48 New Member
Upon using the built in subforum wizards, I find the end product is not exactly what I want, but close to it.

For the purposes of this explanation, I'm going to use the classic example of a store's database. Tables include [Customer], [Employee], [Product], [Sale] (intuitively), whereas the first three tables are linked to [Sale] in a one to many relationship.

When someone goes to buy an item, a form (tied to the [Sale] table) comes up for data entry. It should record things like date, the employee ID who sold the item, the customer info, and the product info, per the tables associated with these records.

The question: How do I, upon entering a product ID in my Sale form, have the form automatically update so that certain fields (such as product name, price, stock, etc) are automatically filled in (for friendly use, allowing the user to double check it's the right product), while leaving the other fields relevant to the Sale itself (date, comment, etc) left unchanged?

In other words, in the one form, linked to [Sale], I need it to access, search through, and display parts of a single record which is found in other tables, while recording to the [Sale] table (just the identifiers like product ID, not all the fields it needs to display).

If this is unclear, let me know so I may clarify. Thank you in advance.
Aug 2 '07 #1
1 1340
MMcCarthy
14,534 Recognized Expert Moderator MVP
OK first of All the Sale table should only contain the following information on Customer, Employee and Product

SaleID (AutoNumber, primary key)
ProductID
Qty
CustomerID
EmployeeID
SaleDate
Comment

No assuming you want to see the sale information create a query as follows and base a form on it.

Expand|Select|Wrap|Line Numbers
  1. SELECT SaleID, Product.ProdName, Sale.Qty, Product.Price*Sale.Qty As SalePrice, Cusomer.Name, Customer.Address, Employee.Name
  2. FROM (((Sale INNER JOIN Product 
  3. ON Sale.ProductID = Product.ProductID)
  4. INNER JOIN Customer
  5. ON Sale.CustomerID = Customer.CustomerID)
  6. INNER JOIN Employee
  7. ON Sale.EmployeeID = Employee.EmployeeID)
  8.  
Aug 6 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I have a main form with a continuous subform. On the main form I have a text field called . It gets populated based on what the user selects in a field on the...
2
by: Claude | last post by:
Let' say we have an application for a production facility running 24/7 broken into 3 shifts 6-2,2-10,10-6 each production report date contains 3 shifts as above in each shift there can be from...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
12
by: swingingming | last post by:
Hi, in the NorthWind sample database, when clicking on the next navigation button on the new order record with nothing on the subform (order details), we got an order with nothing ordered. How can...
9
by: PC Datasheet | last post by:
I'm stuck on something that seems should be easy and I need some help. My main form has an option group with five options. My subform chooses from different lists depending on which option is...
14
by: Anja | last post by:
Hi everyone, I have a sub form that references a query to get the results. However, what I want to do is filter the results further based on a certain criteria. How can I tell the sub form to...
4
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form...
6
NeoPa
by: NeoPa | last post by:
Introduction The first thing to understand about Sub-Forms is that, to add a form onto another form takes a special Subform control. This Subform control acts as a container for the form that you...
11
by: mrowe | last post by:
I am using Access 2003. (I am also using ADO in the vast majority of my code. I recently read a post that indicated that ADO is not all that is was initially cracked up to be. In the back of my...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.