473,508 Members | 2,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Populate Table Using Combo Box WITHOUT FORM

13 New Member
Hello All!

I have been looking around for awhile for an answer to this question, but have been unsuccessful. I currently have a DB with multiple tables (Components, Formulations, Formulation_Details, and Component_Categories). The Components table contains the following headers: Product, JRHPart, Component, MW, and Component Category. All of the information has been filled in, and this table will not change in the future. I have a form that I am using to populate the Formulations table that contains a subform. This subform is linked to the Formulation_Details table that contains these headers: Component, Component Category, MW, mg/L, and Mm.

I would like to set up the subform so the user can select the Component from a drop down list, then the Component Category and MW fields will automatically retreive the desired values from the Components table. They can then move down to the next line and select another component, and so on. I would set it up as seperate boxes on the form to populate each item, but each formulation can have hundreds of components. Any ideas?

The mg/L and Mm fields will be filled in by the user every time. I just want the system to retrieve the value for MW and Component Category.

Thanks!
Nov 26 '12 #1
4 1890
Rabbit
12,516 Recognized Expert Moderator MVP
You can use the AfterUpdate event of the component drop down to populate those two other fields. However, there's no reason to store those two other fields if they're derived from the component. You'll just be wasting disk space and breaking the rules of normalization. Whenever you need to see those other fields, you can just join to the components table to retrieve it.
Nov 26 '12 #2
jmaher196
13 New Member
The Mm field is a Calculated field based on (MW)/(mg/L). MW being molecular weight, and mg/L being the amount used in the formulation. Will the AfterUpdate property work if the subform is in table view? Sorry, I don't work with subforms very often.
Nov 26 '12 #3
zmbd
5,501 Recognized Expert Moderator Expert
Jmaher196:
it is not normally best practice to store calculated values such as you describe for [Mm] as these should normally be derived on demand via query/report.

With that said, depending on how the form is designed, so long as the values are already available, the field should be able to be updated with the desired result.

Before you go much farther, I really think that you should consider: 171.Database Normalization and Table Structures
and you might find: http://www.applecore99.com/tut/tutin...ial for Access very usefull.

IMHO, you'll find that the most common trap in database design is trying to use it as a spreadsheet. Although the tables resemble a spreadsheet, they are worlds apart and there are a lot of descussions about that topic by people that know more than I.
Nov 26 '12 #4
NeoPa
32,557 Recognized Expert Moderator MVP
Certainly the calculable values should be determined by a query rather than being stored. It seems you also need to filter (and possibly cascade-filter) the records from your form though. If so, Cascaded Form Filtering may help.
Nov 27 '12 #5

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

Similar topics

3
53714
by: GL | last post by:
Hi, Is there a way to add a field to an existing table using a query of some sort (without needing to manually add a field to the table). I know how to do it with a make table query, but I have...
1
1701
by: Cillies | last post by:
Hi! I have a form that displays information using DLookUp. Now at present I am going into the query and entering criteria that I want the form to display. i.e. the form is for a sports team and...
8
4847
by: Smartin | last post by:
I have a form in Access97 which facilitates a query against a production Access database. Users will enter some search terms and see a datasheet view of the results in a subform. The prod table is...
2
2731
by: Junior | last post by:
Hi All, I haven't got a response for this question lately and i really need to get this done ASAP. I have a .aspx page that has table two column four rows on it. 1. How do i use codebehind C#...
5
5959
by: Nirmala123 | last post by:
hi... I want to sort the table using combobox values. I give the code here. address.html: <html> <head> <title>Add a new entry</title> </head>
1
8963
by: jyotig | last post by:
hi, i am using combo box for company list in ms-access but if new company name will come that time i am going to table and add new company and again open form and select that company. there is...
5
4805
by: asmi | last post by:
I am new in C# programming. Can anyone plz help me in the following problem. I am changing values in different columns in access database table using c# but these changes are only visible at run...
3
2417
by: bluethunder | last post by:
Good day everyone, I'm having a hard time with my program on how to display the data from table to combo box. I have two tables that have been LEFT JOIN to have their relationship in the Data...
2
1842
by: Horace Martin | last post by:
How do I populate multiple fields on a form by using a combo box. My combo box has 3 col. When I make a selection from my combo box all 3 fields should be filled in on my form. eg. Form Fields:...
0
7115
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
7321
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
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4705
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
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1547
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
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.