472,794 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 3597
On Jul 16, 4:19 pm, Dave <djwest...@gmail.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*******@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
On Jul 16, 4:19 pm, Dave <djwest...@gmail.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!txtA = Me!cboA; in the
AfterUpdate event of cboB, use the statement Me!sbfX.Form!txtB = Me!cboB; in
the AfterUpdate event of cboC, use the statement Me!sbfX.Form!txtC =
Me!cboC; and in the AfterUpdate event of cboD, use the statement
Me!sbfX.Form!txtD = 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!txtA = Me!cboA
Me!sbfX.Form!txtB = Me!cboB
Me!sbfX.Form!txtC = Me!cboC
Me!sbfX.Form!txtD = 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...@localhost.notwrote:
"Dave" <djwest...@gmail.comwrote in message

news:11**********************@k79g2000hse.googlegr oups.com...
On Jul 16, 4:19 pm, Dave <djwest...@gmail.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!txtA = Me!cboA; in the
AfterUpdate event of cboB, use the statement Me!sbfX.Form!txtB = Me!cboB; in
the AfterUpdate event of cboC, use the statement Me!sbfX.Form!txtC =
Me!cboC; and in the AfterUpdate event of cboD, use the statement
Me!sbfX.Form!txtD = 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!txtA = Me!cboA
Me!sbfX.Form!txtB = Me!cboB
Me!sbfX.Form!txtC = Me!cboC
Me!sbfX.Form!txtD = 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...@localhost.notwrote:
"Dave" <djwest...@gmail.comwrote in message

news:11**********************@k79g2000hse.googlegr oups.com...
On Jul 16, 4:19 pm, Dave <djwest...@gmail.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!txtA = Me!cboA; in the
AfterUpdate event of cboB, use the statement Me!sbfX.Form!txtB = Me!cboB; in
the AfterUpdate event of cboC, use the statement Me!sbfX.Form!txtC =
Me!cboC; and in the AfterUpdate event of cboD, use the statement
Me!sbfX.Form!txtD = 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!txtA = Me!cboA
Me!sbfX.Form!txtB = Me!cboB
Me!sbfX.Form!txtC = Me!cboC
Me!sbfX.Form!txtD = 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...@localhost.notwrote:
"Dave" <djwest...@gmail.comwrote in message

news:11**********************@k79g2000hse.googlegr oups.com...
On Jul 16, 4:19 pm, Dave <djwest...@gmail.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!txtA = Me!cboA; in the
AfterUpdate event of cboB, use the statement Me!sbfX.Form!txtB = Me!cboB; in
the AfterUpdate event of cboC, use the statement Me!sbfX.Form!txtC =
Me!cboC; and in the AfterUpdate event of cboD, use the statement
Me!sbfX.Form!txtD = 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!txtA = Me!cboA
Me!sbfX.Form!txtB = Me!cboB
Me!sbfX.Form!txtC = Me!cboC
Me!sbfX.Form!txtD = 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...@localhost.notwrote:
"Dave" <djwest...@gmail.comwrote in message

news:11**********************@k79g2000hse.googlegr oups.com...
On Jul 16, 4:19 pm, Dave <djwest...@gmail.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!txtA = Me!cboA; in the
AfterUpdate event of cboB, use the statement Me!sbfX.Form!txtB = Me!cboB; in
the AfterUpdate event of cboC, use the statement Me!sbfX.Form!txtC =
Me!cboC; and in the AfterUpdate event of cboD, use the statement
Me!sbfX.Form!txtD = 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!txtA = Me!cboA
Me!sbfX.Form!txtB = Me!cboB
Me!sbfX.Form!txtC = Me!cboC
Me!sbfX.Form!txtD = 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
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...
4
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...
0
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...
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...
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: 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...
2
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...
4
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...
9
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...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.