473,322 Members | 1,473 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,322 software developers and data experts.

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 2872
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!frmSubform.cboProduct.RowSource = '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
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...
2
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...
14
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...
1
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...
7
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"...
2
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...
1
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...
9
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...
1
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.