473,739 Members | 9,109 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

updating subform via selection of combo boxes

I want to put the information that the user selects in my combo boxes
into a subform that lies on the same form as the combo boxes.

Thanks for your help already,
Dave

Jul 16 '07 #1
6 3681
On Jul 16, 4:19 pm, Dave <djwest...@gmai l.comwrote:
I want to put the information that the user selects in my combo boxes
into a subform that lies on the same form as the combo boxes.

Thanks for your help already,
Dave
So here's the problem:
I don't know how to update my subform with information stored in a
table but is selected in any or all of 4 combo boxes.

Thanks again,
Dave

Jul 16 '07 #2

"Dave" <dj*******@gmai l.comwrote in message
news:11******** **************@ k79g2000hse.goo glegroups.com.. .
On Jul 16, 4:19 pm, Dave <djwest...@gmai l.comwrote:
>I want to put the information that the user selects in my combo boxes
into a subform that lies on the same form as the combo boxes.

Thanks for your help already,
Dave

So here's the problem:
I don't know how to update my subform with information stored in a
table but is selected in any or all of 4 combo boxes.

Thanks again,
Dave
If I understand correctly, you want to select information in Combo Boxes on
a main Form and update the Form embedded in a Subform Control on that same
main Form. For simplicity, let's assume the names of the Combo Boxes are
cboA, cboB, cboC, and cboD and the corresponding Text Boxes on the Form
embedded in the Subform Control are txtA, txtB, txtC, and txtD. Further,
assume that the Subform Control is named sbfX. For our purposes, the name of
the embedded Form in that Subform Control is immaterial.

To update each Text Box in the Form embedded in the Subform Control as soon
as the selection is made in the corresponding Combo Box, in the AfterUpdate
event of cboA, use the statement Me!sbfX.Form!tx tA = Me!cboA; in the
AfterUpdate event of cboB, use the statement Me!sbfX.Form!tx tB = Me!cboB; in
the AfterUpdate event of cboC, use the statement Me!sbfX.Form!tx tC =
Me!cboC; and in the AfterUpdate event of cboD, use the statement
Me!sbfX.Form!tx tD = Me!cboD.

If, on the other hand, you want to wait until the user has reviewed his
selections and then update, put all the statements in the Click Event of a
cmdDoIt command button, to wit:

Me!sbfX.Form!tx tA = Me!cboA
Me!sbfX.Form!tx tB = Me!cboB
Me!sbfX.Form!tx tC = Me!cboC
Me!sbfX.Form!tx tD = Me!cboD.

If I were going to do the latter, I would examine the requirements to
determine if the updates were to be done regardless of updates to or
selection of data in the Combo Boxes and add code to assure the required
conditions had been met.

Larry Linson
Microsoft Access MVP
Jul 16 '07 #3
On Jul 16, 6:30 pm, "Larry Linson" <boun...@localh ost.notwrote:
"Dave" <djwest...@gmai l.comwrote in message

news:11******** **************@ k79g2000hse.goo glegroups.com.. .
On Jul 16, 4:19 pm, Dave <djwest...@gmai l.comwrote:
I want to put the information that the user selects in my combo boxes
into a subform that lies on the same form as the combo boxes.
Thanks for your help already,
Dave
So here's the problem:
I don't know how to update my subform with information stored in a
table but is selected in any or all of 4 combo boxes.
Thanks again,
Dave

If I understand correctly, you want to select information in Combo Boxes on
a main Form and update the Form embedded in a Subform Control on that same
main Form. For simplicity, let's assume the names of the Combo Boxes are
cboA, cboB, cboC, and cboD and the corresponding Text Boxes on the Form
embedded in the Subform Control are txtA, txtB, txtC, and txtD. Further,
assume that the Subform Control is named sbfX. For our purposes, the name of
the embedded Form in that Subform Control is immaterial.

To update each Text Box in the Form embedded in the Subform Control as soon
as the selection is made in the corresponding Combo Box, in the AfterUpdate
event of cboA, use the statement Me!sbfX.Form!tx tA = Me!cboA; in the
AfterUpdate event of cboB, use the statement Me!sbfX.Form!tx tB = Me!cboB; in
the AfterUpdate event of cboC, use the statement Me!sbfX.Form!tx tC =
Me!cboC; and in the AfterUpdate event of cboD, use the statement
Me!sbfX.Form!tx tD = Me!cboD.

If, on the other hand, you want to wait until the user has reviewed his
selections and then update, put all the statements in the Click Event of a
cmdDoIt command button, to wit:

Me!sbfX.Form!tx tA = Me!cboA
Me!sbfX.Form!tx tB = Me!cboB
Me!sbfX.Form!tx tC = Me!cboC
Me!sbfX.Form!tx tD = Me!cboD.

If I were going to do the latter, I would examine the requirements to
determine if the updates were to be done regardless of updates to or
selection of data in the Combo Boxes and add code to assure the required
conditions had been met.

Larry Linson
Microsoft Access MVP
Larry,

My apologies for the lack of clarity. Thank you for your response.

Let me be more specific...

I have a main form (DR Form) with 4 combo boxes (ie cbo1, cbo2, etc)
and a subdatasheet (the subform...let's call it subInfo) below the
combo boxes on the DR Form. I hope this clears up confusion of the
interface we are working with.

The 4 combo boxes have pre-populated criteria that update each other
depending on selections of the combo boxes. For example, user selects
the name Dave from cbo1. The other 3 combo boxes are now updated to
Dave's Address, Contact Info, and State of Birthplace (cbo2, cbo3,
cbo4, respectively). So now that the user has selected Dave as a
name, the other 3 combo boxes are now auto-updated with some of Dave's
personal information (these pieces of information are stored in
separate but linked tables).

With this process of auto-updating the combo boxes using SQL Select
statement in the afterupdate sub procedure of the combo boxes, I am
now wanting the criteria of combo boxes to be displayed with the rest
of the information tied to the name Dave (pulling this info straight
from a table) in subInfo. And even when some of the combo boxes
aren't selected I'd want all choices of the unselected combo box(es)
tied to the name Dave to be put in the subInfo. The subInfo layout
should be like a spreadsheet or like a table in Access.

I hope this is clear enough and is understood. Thank you in advance!

Dave

And I'm thinking some of this can be done in the subInfo by specifying
the column I want the data to be put in? It's above my head.

Jul 17 '07 #4
On Jul 16, 6:30 pm, "Larry Linson" <boun...@localh ost.notwrote:
"Dave" <djwest...@gmai l.comwrote in message

news:11******** **************@ k79g2000hse.goo glegroups.com.. .
On Jul 16, 4:19 pm, Dave <djwest...@gmai l.comwrote:
I want to put the information that the user selects in my combo boxes
into a subform that lies on the same form as the combo boxes.
Thanks for your help already,
Dave
So here's the problem:
I don't know how to update my subform with information stored in a
table but is selected in any or all of 4 combo boxes.
Thanks again,
Dave

If I understand correctly, you want to select information in Combo Boxes on
a main Form and update the Form embedded in a Subform Control on that same
main Form. For simplicity, let's assume the names of the Combo Boxes are
cboA, cboB, cboC, and cboD and the corresponding Text Boxes on the Form
embedded in the Subform Control are txtA, txtB, txtC, and txtD. Further,
assume that the Subform Control is named sbfX. For our purposes, the name of
the embedded Form in that Subform Control is immaterial.

To update each Text Box in the Form embedded in the Subform Control as soon
as the selection is made in the corresponding Combo Box, in the AfterUpdate
event of cboA, use the statement Me!sbfX.Form!tx tA = Me!cboA; in the
AfterUpdate event of cboB, use the statement Me!sbfX.Form!tx tB = Me!cboB; in
the AfterUpdate event of cboC, use the statement Me!sbfX.Form!tx tC =
Me!cboC; and in the AfterUpdate event of cboD, use the statement
Me!sbfX.Form!tx tD = Me!cboD.

If, on the other hand, you want to wait until the user has reviewed his
selections and then update, put all the statements in the Click Event of a
cmdDoIt command button, to wit:

Me!sbfX.Form!tx tA = Me!cboA
Me!sbfX.Form!tx tB = Me!cboB
Me!sbfX.Form!tx tC = Me!cboC
Me!sbfX.Form!tx tD = Me!cboD.

If I were going to do the latter, I would examine the requirements to
determine if the updates were to be done regardless of updates to or
selection of data in the Combo Boxes and add code to assure the required
conditions had been met.

Larry Linson
Microsoft Access MVP
Larry,

My apologies for the lack of clarity. Thank you for your response.

Let me be more specific...

I have a main form (DR Form) with 4 combo boxes (ie cbo1, cbo2, etc)
and a subdatasheet (the subform...let's call it subInfo) below the
combo boxes on the DR Form. I hope this clears up confusion of the
interface we are working with.

The 4 combo boxes have pre-populated criteria that update each other
depending on selections of the combo boxes. For example, user selects
the name Dave from cbo1. The other 3 combo boxes are now updated to
Dave's Address, Contact Info, and State of Birthplace (cbo2, cbo3,
cbo4, respectively). So now that the user has selected Dave as a
name, the other 3 combo boxes are now auto-updated with some of Dave's
personal information (these pieces of information are stored in
separate but linked tables).

With this process of auto-updating the combo boxes using SQL Select
statement in the afterupdate sub procedure of the combo boxes, I am
now wanting the criteria of combo boxes to be displayed with the rest
of the information tied to the name Dave (pulling this info straight
from a table) in subInfo. And even when some of the combo boxes
aren't selected I'd want all choices of the unselected combo box(es)
tied to the name Dave to be put in the subInfo. The subInfo layout
should be like a spreadsheet or like a table in Access.

I hope this is clear enough and is understood. Thank you in advance!

Dave

And I'm thinking some of this can be done in the subInfo by specifying
the column I want the data to be put in? It's above my head.

Jul 17 '07 #5
On Jul 16, 6:30 pm, "Larry Linson" <boun...@localh ost.notwrote:
"Dave" <djwest...@gmai l.comwrote in message

news:11******** **************@ k79g2000hse.goo glegroups.com.. .
On Jul 16, 4:19 pm, Dave <djwest...@gmai l.comwrote:
I want to put the information that the user selects in my combo boxes
into a subform that lies on the same form as the combo boxes.
Thanks for your help already,
Dave
So here's the problem:
I don't know how to update my subform with information stored in a
table but is selected in any or all of 4 combo boxes.
Thanks again,
Dave

If I understand correctly, you want to select information in Combo Boxes on
a main Form and update the Form embedded in a Subform Control on that same
main Form. For simplicity, let's assume the names of the Combo Boxes are
cboA, cboB, cboC, and cboD and the corresponding Text Boxes on the Form
embedded in the Subform Control are txtA, txtB, txtC, and txtD. Further,
assume that the Subform Control is named sbfX. For our purposes, the name of
the embedded Form in that Subform Control is immaterial.

To update each Text Box in the Form embedded in the Subform Control as soon
as the selection is made in the corresponding Combo Box, in the AfterUpdate
event of cboA, use the statement Me!sbfX.Form!tx tA = Me!cboA; in the
AfterUpdate event of cboB, use the statement Me!sbfX.Form!tx tB = Me!cboB; in
the AfterUpdate event of cboC, use the statement Me!sbfX.Form!tx tC =
Me!cboC; and in the AfterUpdate event of cboD, use the statement
Me!sbfX.Form!tx tD = Me!cboD.

If, on the other hand, you want to wait until the user has reviewed his
selections and then update, put all the statements in the Click Event of a
cmdDoIt command button, to wit:

Me!sbfX.Form!tx tA = Me!cboA
Me!sbfX.Form!tx tB = Me!cboB
Me!sbfX.Form!tx tC = Me!cboC
Me!sbfX.Form!tx tD = Me!cboD.

If I were going to do the latter, I would examine the requirements to
determine if the updates were to be done regardless of updates to or
selection of data in the Combo Boxes and add code to assure the required
conditions had been met.

Larry Linson
Microsoft Access MVP

Larry - My apologies for the lack of clarity. Thank you for your
response.

Let me be more specific...

I have a main form (RD Form) with 4 combo boxes (i.e. cbo1, cbo2, etc)
and a subdatasheet (the subform...let's call it subInfo) below the
combo
boxes on the RD Form. I hope this clears up confusion of the
interface
we are working with.

The 4 combo boxes have pre-populated criteria that update each other
depending on selections of the combo boxes. For example, user selects
the name Dave from cbo1. The other 3 combo boxes are now updated to
Dave's Address, Contact Info, and State of Birthplace (cbo2, cbo3,
cbo4,
respectively). So now that the user has selected Dave as a name, the
other 3 combo boxes are now auto-updated with some of Dave's personal
information (these pieces of information are stored in separate but
linked tables).

With this process of auto-updating the combo boxes using SQL Select
statements in the afterupdate sub procedure of the combo boxes, I am
now
wanting the criteria of combo boxes to be displayed with the rest of
the
information tied to the name Dave (pulling this info straight from a
table) in subInfo. And even when some of the combo boxes aren't
selected I'd want all choices of the unselected combo box(es) that are
tied to the name Dave to be put in the subInfo. The subInfo layout
should be like a spreadsheet or like a table in Access.

I hope this is clear enough and is understood. Thank you in advance!

Dave

And I'm thinking some of this can be done in the subInfo by specifying
the column I want the data to be put in? This is a bit above my head.

Jul 17 '07 #6
On Jul 16, 6:30 pm, "Larry Linson" <boun...@localh ost.notwrote:
"Dave" <djwest...@gmai l.comwrote in message

news:11******** **************@ k79g2000hse.goo glegroups.com.. .
On Jul 16, 4:19 pm, Dave <djwest...@gmai l.comwrote:
I want to put the information that the user selects in my combo boxes
into a subform that lies on the same form as the combo boxes.
Thanks for your help already,
Dave
So here's the problem:
I don't know how to update my subform with information stored in a
table but is selected in any or all of 4 combo boxes.
Thanks again,
Dave

If I understand correctly, you want to select information in Combo Boxes on
a main Form and update the Form embedded in a Subform Control on that same
main Form. For simplicity, let's assume the names of the Combo Boxes are
cboA, cboB, cboC, and cboD and the corresponding Text Boxes on the Form
embedded in the Subform Control are txtA, txtB, txtC, and txtD. Further,
assume that the Subform Control is named sbfX. For our purposes, the name of
the embedded Form in that Subform Control is immaterial.

To update each Text Box in the Form embedded in the Subform Control as soon
as the selection is made in the corresponding Combo Box, in the AfterUpdate
event of cboA, use the statement Me!sbfX.Form!tx tA = Me!cboA; in the
AfterUpdate event of cboB, use the statement Me!sbfX.Form!tx tB = Me!cboB; in
the AfterUpdate event of cboC, use the statement Me!sbfX.Form!tx tC =
Me!cboC; and in the AfterUpdate event of cboD, use the statement
Me!sbfX.Form!tx tD = Me!cboD.

If, on the other hand, you want to wait until the user has reviewed his
selections and then update, put all the statements in the Click Event of a
cmdDoIt command button, to wit:

Me!sbfX.Form!tx tA = Me!cboA
Me!sbfX.Form!tx tB = Me!cboB
Me!sbfX.Form!tx tC = Me!cboC
Me!sbfX.Form!tx tD = Me!cboD.

If I were going to do the latter, I would examine the requirements to
determine if the updates were to be done regardless of updates to or
selection of data in the Combo Boxes and add code to assure the required
conditions had been met.

Larry Linson
Microsoft Access MVP
Larry - My apologies for the lack of clarity. Thank you for your
response.

Let me be more specific...

I have a main form (RD Form) with 4 combo boxes (i.e. cbo1, cbo2, etc)
and a subdatasheet (the subform...let's call it subInfo) below the
combo boxes on the RD Form. I hope this clears up confusion of the
interface we are working with.

The 4 combo boxes have pre-populated criteria that update each other
depending on selections of the combo boxes. For example, user selects
the name Dave from cbo1. The other 3 combo boxes are now updated to
Dave's Address, Contact Info, and State of Birthplace (cbo2, cbo3,
cbo4, respectively). So now that the user has selected Dave as a
name, the other 3 combo boxes are now auto-updated with some of Dave's
personal information (these pieces of information are stored in
separate but linked tables).

With this process of auto-updating the combo boxes using SQL Select
statements in the afterupdate sub procedure of the combo boxes, I am
now wanting the criteria of combo boxes to be displayed with the rest
of the information tied to the name Dave (pulling this info straight
from a table) in subInfo. And even when some of the combo boxes
aren't selected I'd want all choices of the unselected combo box(es)
that are tied to the name Dave to be put in the subInfo. The subInfo
layout should be like a spreadsheet or like a table in Access.

And I'm thinking some of this can be done in the subInfo by specifying
the column I want the data to be put in?

I hope this is clear enough and is understood. Thank you in advance!

Dave

Jul 18 '07 #7

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

Similar topics

2
3326
by: Cameron | last post by:
Hi, For the database I am currently working on, my employer would like the ability to use multiple combo boxes in order to filter the database. For instance the structure of the company is based on regions, which are managed by a number of coordinators, who oversee a large group of associates. I would like to use a combo box so that people accessing the database can choose a particular region and then have a second combo box that only...
4
2293
by: CSDunn | last post by:
Hello, I have a combo box (Combo7) that needs to call a function during the After Update event of the combo box. The function resides in an Access 2000 ADP Module called MMAnswerData_code. The following is the code of the function: Public Function SubFormRS(FrmTarget As Object) Forms!frmAD_OpeningForm!FrmTarget.RecordSource = "EXEC dbo.AdSubFormRecSource " & Forms!frmAD_OpeningForm!SubFormFilter
0
2353
by: CSDunn | last post by:
Hello, In Access ADP's that connect to SQL Server databases, any time I have a situation where I have a combo box in a main form that looks up a record in a subform, the subform record source has to be based on either a View or a Table. I can almost always use a View, and it helps to do this since I can have better control over the size of the RecordSet of the subform. There are times when the use of a Stored Procedure would give me...
1
2203
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...
1
2291
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
15844
by: natwong | last post by:
Hi All, I'm a newbie in terms of Access and some of its functionality . I've been stuck on this problem for a couple days, even after searching the Web, etc. Currently I have five combo boxes (actually list boxes) that are multiselects in my main form. I need to use these combo boxes to filter a subform within my main form. My combo boxes are as follows: 1. A - 4 select options 2. B - 10 select options 3. C - 4 select options
2
1908
by: docsix | last post by:
I am having trouble populating a combo box in a subform. Currently I have two combo boxes on a single form that works. This is my current setup: Table:Facilities - FacilityID ... FacilityType 1 ............ Bus 2 ............ Library Table: Additional DetailID .... Details .............. FacilityID 1 ..............TImetable .......... Bus
4
8849
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form which allows me to edit the record in the subform. What I want to happen is for subform with the new edits to be updated on the main form when I close the popup. I'm sure this is a very small bit of code in the the 'On close' event for the popup...
9
4998
by: Marianne160 | last post by:
Hi, I know there are various answers to this problem available on the web but none of them seem to work for me. I am using Access 2003 to make a form to look up data from a table. I have so far created three combo boxes that cascade down from Name to Project to Date and when this has been chosen I have four textbox fields I want to display based on this selection. I tried linking the last combo box comboDate to update these fields after...
0
8792
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,...
0
9479
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
9337
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...
0
9209
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
6054
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4826
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3280
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
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.