Results 1 to 4 of 4
  1. #1
    JFo is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    393

    requery a combo in subform from main form

    I have a main form frmInspections that has a subform frmEquipment



    I am trying to requery a combo in subform (cmbEquipDetails) based on a selection in the main forms combo box

    I thought this code should work however it is not
    in afterupdate of first combo

    Forms!frmInspections!frmEquipment.Form![cmbEquipDetails].Requery = True

    Any Ideas?

    Thanks

  2. #2
    JFo is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    393
    Figured it out it is not

    'Me.cmbEquipDetails.Requery = True
    'Forms!frmInspections!frmEquipment.Form![cmbEquipDetails].Requery = True
    [Forms]![frmInspections].[Form]![frmEquipment]![cmbEquipDetails].Requery = True
    'Me![frmEquipment].Form![cmbEquipDetails].Requery = True

    This one works

    [Forms]![frmInspections].[Form]![frmEquipment]![cmbEquipDetails].Requery

    Cheers to anyone that had a look

  3. #3
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by JFo View Post
    Figured it out it is not

    'Me.cmbEquipDetails.Requery = True
    'Forms!frmInspections!frmEquipment.Form![cmbEquipDetails].Requery = True
    [Forms]![frmInspections].[Form]![frmEquipment]![cmbEquipDetails].Requery = True
    'Me![frmEquipment].Form![cmbEquipDetails].Requery = True

    This one works

    [Forms]![frmInspections].[Form]![frmEquipment]![cmbEquipDetails].Requery

    Cheers to anyone that had a look
    Actually, the method you have used is a NON-STANDARD way of doing it and it really should be:
    Forms!frmInspections!YourSubformCONTROLNameHere.Fo rm.cmbEquipDetails.Requery

    Where YourSubformCONTROLNameHere is the name of the control on the parent form which HOUSES the subform. It is NOT the name of the subform unless the subform control and the subform are named exactly the same.

  4. #4
    JFo is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    393
    Thanks for the feedback, yeah I have changed it now and have done many more with the same structure. Here is the link for anyone interested

    http://access.mvps.org/access/forms/frm0031.htm

    Thanks

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

Similar Threads

  1. Assign Combo Box from Main form to Subform
    By tbassngal in forum Forms
    Replies: 5
    Last Post: 07-18-2011, 04:11 PM
  2. Subform Combobox based on Main form combo box
    By accessmom in forum Forms
    Replies: 5
    Last Post: 02-21-2011, 07:02 AM
  3. Replies: 5
    Last Post: 01-02-2011, 10:09 AM
  4. Replies: 6
    Last Post: 01-13-2010, 02:41 PM
  5. Replies: 0
    Last Post: 08-17-2008, 12:19 PM

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