473,789 Members | 2,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to popupate a subform based on a field selection

8 New Member
Hi,

I'm trying to create an "overview" form. And I haven't been able to figure out how to get Access to do what I want yet.
Basicly what I want, is to populate a subform based on a field selection. In other words, I have several fields like colour, shape, location etc. on my Main form. Now I want to add a subform to my unbound mainform, showing what I have in a table, depending on what is selected in the fields.
So if I choose red, triangles from Warehouse 2 I'd like to show all the different products in my table that would match this criteria in my subform.

But how do I go about it? Do I create a field on my mainform and change the value depending on what I select, and then somehow link my subform to that field or do I make it as some sort of VB code?
I think the big issue is that I want to be able to switch what I show in my subform depending on what is selected on the mainform (I want to show a list of records, not just a single record), and I'm not entirely sure how to write such dynamic syntax... or where...

I hope you can help,

Br, MnMs
May 23 '07 #1
2 1842
mnms
8 New Member
Gah, It seems every time I'm stuck at some problem and need some help I post here and voila - I come up with the solution myself - sorry about this. I found a solution to my problem. I just needed to set the recordsouce dynamicly. Fairly easy really. The example I found states:

On event, add something like this:

Me.Subformname. Form.RecordSour ce = "SELECT * FROM TableName;"
Me.Subformname. Form.Requery

or just give the name of a query.
Me.Subformname. Form.RecordSour ce = "queryname"

I did try and figure this out for a couple of days first though - so feel really silly now. I hope someone else can use this post...
May 23 '07 #2
suzanne099
7 New Member
Thanks so much. I was trying to figure this out for days! Just wanted to let you know you really helped me so thank you for posting your solution!
May 24 '07 #3

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

Similar topics

0
1717
by: Alienz | last post by:
hiya! I wanted to make a multiple selection drop down list and I found the easiest way to do this was by creating a subform linked to a table with 2 values, the 1st value links to the main form and the 2nd value stores the results. The drop down list does a select function and you can therefore select the value from it and a new drop down box immediately appears below it and you can choose more values. But, I find it's not perfect. ...
25
10268
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 data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
1
2155
by: NBruch | last post by:
Ok let me explain what im trying to do: i need a combo box which needs to be linked to a listbox (or combo box doesnt matter which really) then the listbox should bring up the record in a subform. so you pick a name (in the combo box in the main form) then it should bring up all the dates for which the person has a record for (in the list box or combo box) and then once you pick a date it should bring up the specific record you want...
1
2205
by: jerry.ranch | last post by:
So I've been playing with combo boxes and subforms. Finally, I can make a selection in a combo box, and have that drive an after update event to open a query or a form. Works famously. Now the next step is to bury the form in the same form where the cmb is located (as a subform) I use two linked cmb. And I have linked the second cmb with the subform. A selection in the first cmb limits the selection in the second cmb. A selection...
10
1729
by: sara | last post by:
Hi - I am developing a simple app, and just found a problem that I can't fix after 4 hours of trying. I display a list of customers, and the user chooses one and displays "orders". The frmOrders displays correctly, with the subform - frmOrders_sfrmCustInfo - on top that is correct. The subform displays cust info - name, address, phone. Name is from a function that takes
6
3803
by: MLH | last post by:
When the vehicle entry form (frmVehicleEntryForm) first opens, the additional owner SubForm control (frmAddnlOwnrListSubForm) is enabled. You can click on it and it will accept the focus. But after you enter data to the first field on the main form (a VIN#), that is not the case. The SubForm control becomes disabled and will not accept the focus. Dunno why. There's no child/master link fields. They have no settings - at least not in design...
1
2292
by: MLH | last post by:
I have a form with a subform control on it listing records returned by a saved query named UnbilledVehicles. I would like to put command buttons on the main form to apply dynamic filters to the records displayed in the subform control. Say, for instance, to list only 2004 model cars. I'm seeking the simplest approach. The main form is frmCreateInvoice, the subform control is named frmCreateInvoiceSubFormCtl and the actual sub- form is...
9
9702
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a master-child link to the first subform. subform2 - Master Field: subTrainingModule.Form!TrainingModuleTopicSK Child Field: TrainingModuleTopicSK
1
2474
by: Rosie | last post by:
I have a main form with header info w/ 'tHeader' as the control source. I have a subform with 'tDetail' as a control source. They're strung together by a field named MA_ID. This works fine. I have a field within the subform that I want to update via a combobox located on the same subform.
0
9666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10410
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5418
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4093
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 we have to send another system
2
3701
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.