473,396 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to popupate a subform based on a field selection

8
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 1824
mnms
8
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.RecordSource = "SELECT * FROM TableName;"
Me.Subformname.Form.Requery

or just give the name of a query.
Me.Subformname.Form.RecordSource = "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
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
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...
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...
1
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...
1
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...
10
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...
6
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...
1
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...
9
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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
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
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,...

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.