By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,679 Members | 2,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,679 IT Pros & Developers. It's quick & easy.

updating subform via selection of combo boxes

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.