Results 1 to 3 of 3
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    requery on a parent form when updating a value on the subform

    when the value in the combo box on a subform (cboUnits_LampPowerTab) is updated


    I want the value shown in a combo box on the parent form to also update (cmbUnits)

    the value is the same field / record shown in 2 locations; they are a redundant entries for the convenience of the user

    the code that i thought would work is:

    Code:
    Private Sub cboUnits_LampPowerTab_AfterUpdate()
        Me.Parent!cmbUnits.Requery
    End Sub
    but the parent field does not update

    (some of you may have noticed that soon as i get near parent form / subform code... i'm a complete "don't get it" .. so my apologies in advance ...it's just this wall against knowledge that i seem to have =: -(
    maybe it has nothing to do with parent / subform at all? do i need some sort of repaint (?)


    many thanks in advance,
    mark

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    You only need to requery a combo box if its row source is changed, or if the table/query it draws its values from is updated.

    In your case, you just want to change the value in a combo box, so try me.parent!cmbunits = me!cboUnits_Lamp_Power_Tab

    For this to work properly, the row source and bound coumn of both combos should be the same.

  3. #3
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    BANG!
    spot on, it worked (and i gained a bit of insight into the logic of it all)

    thnx m.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 09-17-2017, 09:59 PM
  2. Replies: 11
    Last Post: 04-09-2016, 08:54 PM
  3. Replies: 2
    Last Post: 04-08-2015, 04:06 PM
  4. Replies: 12
    Last Post: 01-05-2013, 06:51 PM
  5. Replies: 5
    Last Post: 03-17-2011, 06:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums