473,695 Members | 2,054 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

combobox in subform related to field in main form

Hello,

I hava a main form F1, form with a subform F2 in datasheet view.
There is a combobox in the main form C1, and a combobox C2 in the
subform.

I want the dropdown options of the combobox in C2 to change depending
on the value selected in C1.

I've tried to specify the datasurce for the C2 values as:

select columname from table where columname1 = Forms!F1!C1

but I can't get any values in the options forcombobox C2, and they do
not change when the value in C1 is changed.

How can I make this work?

Thanks
Mariel

Sep 6 '06 #1
1 1893
Hi Mariel,

The syntax for interfacing with a combobox on a subform is something
like this:

From a command button on the main form:

Private Sub Command1_Click( )
Me.SubformName. Form.Combobox1. RowSourceType = "Value List"
Me.SubformName. Form.Combobox1. RowSource = "test1;test2;te st3"
End Sub

Me is the main form - then follow it by a period and the name of the
subform followed by a period and the class type "Form" followed by a
period and the name of the combobox on the subform. In my example I set
the rowsourceType property of the combobox on the subform to a "Value
List", then I add the values to the value list - followed by semicolons
withing the string of values. You can change Command1_Click to your
combobox on the main form.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Sep 6 '06 #2

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

Similar topics

1
1692
by: jdk | last post by:
I have a main form where a students name is selected. After selected the name- the subform populates all criteria related to the students program. I have 3 combo boxes (Which choose a subject area- then a subheading under the subject) in the subform that determine the data in the third combobox listing. The problem is that if I run the subform by itself, the combobox shows the exact data that I want. However when I run the main form, ...
25
10236
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...
7
8517
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way of doing it. I have a table with products, tblProducts, some of them are Active while others are Inactive. The form shows all the products purchased by a customer, both Active and Inactive in a ComboBox, cbProducts. My client wants to view all...
4
7013
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which means showing all the data put in previously (ie showing this via the requery and the continuous...
5
5253
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test box that is populated with the code =subfrm_media_review_sec_party.Form!first_name & " " & subfrm_media_review_sec_party.Form!last_name It works except that when I flip through the names it populates the parent form with the name of what ever...
2
2506
by: Susan Bricker | last post by:
Greetings! Still the same application (as previous posts). I worked on the app while at work (don't tell my boss ... cause this is just for fun and not work related) and the form was working, but now when I try to repeat the code at home (for real) it won't work. I suspect that I haven't replicated the logic and forms at home from what I remember that I did while at work. My subform is based on a table called "tblTrialClass" and it...
1
2085
by: Igor Kramarsich - EDIT | last post by:
Hello, I simple not see solution to this problem. I have one form with subform. In form is define number of job, type of job, sector of organization and date of job. Subform is a query (as I need to made calculation every line) define by number of job (what is connection with main form), person who made job, kind of work and other. Problem is that kind of work grow so much. From started around 10, now is
1
3224
by: bcreighton | last post by:
I have created a bound subform on an unbound masterform linked together with a common field (A store's identification number) using an unbound combobox on the masterform and an invisible field on the subquery, which filters for a particular store. The subform is in continuous mode. So, what you see when you select a store is a list of all the items that that have not been billed for. There is a simple yes no field that filters out all...
11
12304
by: DSR | last post by:
Help Please... I would like to populate a combo box on a form with a query that compares data from two tables. Any record that is unique in table1 should continue to populate my combobox. The instant the record appears also in table2 it should no longer be listed in my combo box. This is not a key field in either of the tables. Basically what I am trying to do is prevent the user from entering duplicate values even though it is not a key...
0
8625
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
8565
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8841
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
8822
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7658
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...
1
6488
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2997
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
2269
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.