Re: updating subform via selection of combo boxes




"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


.



Relevant Pages

  • RE: Combo boxes on continuous subform
    ... but when I change the form to a continuous subform and put it on a main form, ... the references to the subform textboxes don't work. ... > This general strategy can work with any number of combo boxes. ... > ‘ AfterUpdate event of first combo box ...
    (microsoft.public.access.forms)
  • Re: Update combo box in subform (After Update event)
    ... "My original plan was to simply link these by product id as a master and child field, however as the product and category combo boxes are unbound I don’t think this is possible. ... I can see why category would be unbound ... ... Is the Components subform ON the Product subform, or is it on the main form directly? ...
    (microsoft.public.access.forms)
  • Re: Combo Box not activating subform
    ... I have two combo boxes, ... Since you say your combos work properly, and cause the subform to deliver ... should need is a Requery the subform, on the AfterUpdate event of combo2. ... When I select my office location and department nothing happens. ...
    (microsoft.public.access.forms)
  • RE: Is it possible
    ... I have 3 cascading combo boxes. ... The main form is based on the RF Table and the subform is based on ... There could be many more RFQ# 1a's, but he might not select them this time. ...
    (microsoft.public.access.forms)
  • Re: error 3048 - Cannot open any more databases
    ... into the Row Source Type Property thereby, I opening the "connection" to the ... I am using these combo boxes not only as a way of selecting a ... the same subform, just inserted 48 times. ... in the parent form as well that references the child forms. ...
    (microsoft.public.access.formscoding)