473,545 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combo Boxes and Subforms

I've posted this a few times without any luck, hoping for some fresh
ideas on this. I'm pretty certain this can be done.

I've been using a micrsoft template to create a supplier database
called the Inventory management database, I have changed this so that
there is a link in the relationships with the suppliers so that every
product entered has a specific supplier related, thats fine the main
problem I've encountered is setting up the combo boxes.

When the SupplierID is selected in the main form I want the productID
inside the subform to limit its list from everyone to just that
supplier.

I have looked on this site:
http://www.techonthenet.com/access/c...ked_combos.php
involving Populating one combo box based on the selection of another
combo box

It works great on one form only can it work with a subform set up like
the one I have?

Jan 17 '07 #1
3 2890
I haven't done a whole lot with subforms. I usually use directed forms
like I would when I use ASP.

When I do use subforms it really quite simple. You choose the two
fields that you want to link together between the subform and the main
form. Then you have your combobox set up to move to whatever record
you selected within the AfterUpdate method.

Usually I let the wizards (combobox and subform) do all the work and
then I modify my subform however I would like.

Now, if you're using Unbound forms then you've created more work for
yourself and you will have to modify the filter or recordset of the
subform yourself. I believe these can be accessed through:

me.subformname. form.recordset
and
me.subformname. form.filter

but you might want to check the help on subforms for that.

Cheers,
Jason Lepack

Phil wrote:
I've posted this a few times without any luck, hoping for some fresh
ideas on this. I'm pretty certain this can be done.

I've been using a micrsoft template to create a supplier database
called the Inventory management database, I have changed this so that
there is a link in the relationships with the suppliers so that every
product entered has a specific supplier related, thats fine the main
problem I've encountered is setting up the combo boxes.

When the SupplierID is selected in the main form I want the productID
inside the subform to limit its list from everyone to just that
supplier.

I have looked on this site:
http://www.techonthenet.com/access/c...ked_combos.php
involving Populating one combo box based on the selection of another
combo box

It works great on one form only can it work with a subform set up like
the one I have?
Jan 17 '07 #2
Sort of... You're going to have to reference the form and subform by
name though. Once you change the value of the main form's combo
(AfterUpdate event), you need to set the subform's combo box RowSource
(which will be based on the value of the main form's combo).

For example, if you choose "XYZ" from the Supplier combo, in the
AfterUpdate event you have to say something like (and this isn't the
proper syntax) "form!frmSubfor m.cboProduct.Ro wSource = 'Select * from
SomeTable where Supplier = ' & me.cboSupplier & '"

That is EXTREMELY convoluted, but the logic is correct. Do some
searches on referencing a subform's object from a main form and you
should be able to find the proper syntax to use.

Phil wrote:
I've posted this a few times without any luck, hoping for some fresh
ideas on this. I'm pretty certain this can be done.

I've been using a micrsoft template to create a supplier database
called the Inventory management database, I have changed this so that
there is a link in the relationships with the suppliers so that every
product entered has a specific supplier related, thats fine the main
problem I've encountered is setting up the combo boxes.

When the SupplierID is selected in the main form I want the productID
inside the subform to limit its list from everyone to just that
supplier.

I have looked on this site:
http://www.techonthenet.com/access/c...ked_combos.php
involving Populating one combo box based on the selection of another
combo box

It works great on one form only can it work with a subform set up like
the one I have?
Jan 17 '07 #3
Hey

I'm not very good with giving you an answer with such a vague
description. There are too many different ways you could have set
everything up, each one would change the answer slightly.

So if you would like, you are more than welcome to email your database
and I will have a look and let you know exactly how to make it work.

Cheers

Jan 18 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3508
by: Krisa | last post by:
Hello all, I just discovered something (stop me if you've heard this before....) that was causing me a significant performance hit when opening a form with subforms. To speed up loading the form, I set the rowsources of its, and its subforms', combo boxes in the "Enter" events of the combo boxes. That's the standard trick for not...
2
1603
by: CSDunn | last post by:
Hello, In an Access 2000 ADP subform, I have a set of two Radio buttons in a single group that are bound to a field called 'Completed'. The Completed field comes from an SQL Server 2000 table, is of type Bit (so it takes 0 or 1). I need to set up a procedure so that when the radio button has a value of 1, a series of combo boxes in the...
14
4947
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons for things like delete, save, edit, cancel buttons - in the footer, or on the form detail section? 2. If in the footer, how do you add them to the...
1
2992
by: flamethrower01 | last post by:
Hi, I have a form (with 4 subforms) which is filtered by 3 combo boxes. Upon loading the form, the form populates fine. After the first combo box, the form works fine. After the second one , all 4 forms are correctly populated yet 2 of the 4 subforms' records cannot be modified.
7
1832
by: badboybrown | last post by:
I know that this is an age old question and it has been approached a few times, but I've hit a wall and require some help. I have various combo boxes that contain values that are both "current" and "not current". The problem is if you try to limit the drop down to only the "current" values then your old records show a blank if the field...
2
2276
by: SPOILED36 | last post by:
I am building a database to track attendance. I have one main form with multiple subforms. Within one of the subforms name sfrDailyAttendance, I also have cascading combo boxes (cboCategory and cboException) to filter difference absences (ie.Regular, Overtime, etc). cboCategory is filtered as follows: !!... Because I have the subform set...
1
1334
by: hsangi | last post by:
I have a Main Form with a combo box at the top. The combo box has 6 different values it reads from a table. I have 6 subforms which I have already built. Depending on the value selected in the combo box I want to display directly below the combo box its corresponding subform. Can someone please give me an example of how I would do this?
9
16791
by: frys | last post by:
Access 2003 Windows XP I have a form that is for tracking attendance at programs. the main form is the program information, and the sub form is the attendance information. I have 5 homes and need to switch between each home at any given time. Currently i use a tab form with 5 subforms attached filtering the attendance data for each home....
1
2851
by: kinglioness | last post by:
Hello All, I am new to this forum so I apologize if this quesiton was asked already. Although i did search but i couldn't find. I have 2 combo boxes one unbound and the other bound they are on the main form. One (combo box) filters the other. I would like for both boxes to filter the subforms which by the way are on tab controls I have 8...
0
7656
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. ...
0
7805
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...
1
7416
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...
0
7752
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
4944
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3449
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...
0
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1878
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
0
701
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.