Re: updating subform via selection of combo boxes
- From: "Larry Linson" <bouncer@xxxxxxxxxxxxx>
- Date: Mon, 16 Jul 2007 23:30:35 GMT
"Dave" <djwest101@xxxxxxxxx> wrote in message
news:1184622175.916697.156310@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jul 16, 4:19 pm, Dave <djwest...@xxxxxxxxx> wrote:
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
.
- Follow-Ups:
- References:
- Prev by Date: Re: Split a Memo field
- Next by Date: Re: database - what else
- Previous by thread: Re: updating subform via selection of combo boxes
- Next by thread: Re: updating subform via selection of combo boxes
- Index(es):
Relevant Pages
|