Results 1 to 3 of 3
  1. #1
    lewisoh is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2015
    Posts
    2

    Requery a subform form a combo box in a main form!

    Good morning,


    I have a problem trying to requery a subform from a combo box used to select a category in a main form. I have tried several variations in the coding but nothing seems to work. I know the suform works because when I open it up separately, it asks for the data selected from (combo0) I type in a category and it filters correctly. It appears to be something in the way I am structuring the (Combo0) AfterUpdate property’s coding. This is what I have;
    Main Form: Category View Form
    Subform: Category View Subform
    Combo Box: ComboO
    AfterUpdate: Private Sub Combo0_AfterUpdate()
    Forms![Category View Form]![Category Query subform].Requery
    End Sub
    I have tried the above coding which does nothing. I have tried Forms!Category Query subform.Requery
    Which produces “Compile Error:
    Syntax Error”
    message. So my question is what am I doing wrong? Thanks for the feedback!

  2. #2
    JamesDeckert is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    Salina, KS
    Posts
    262
    here's a great reference
    http://access.mvps.org/access/forms/frm0031.htm

    try this
    Me!
    [Category Query subform].form.Requery

  3. #3
    lewisoh is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2015
    Posts
    2

    Thanks James

    [QUOTE=JamesDeckert;292163]here's a great reference
    http://access.mvps.org/access/forms/frm0031.htm

    try this
    Me!
    [Category Query subform].form.Requery

    Itried the above mentioned and the subform did nothing similar to the first code I had tried. I am thinking that the AfterUpdate is not seeing the subform it is trying to reference for whatever reason. I am really new to Access so this is pretty deep for me. I had succesfully made a second combo box filter by what was being put into the first one in another form, but I think that was working because both combo boxes were in the same main form. Tere appears to be something you must do differently when referencing a subfom. Even though it is on the same main form it is a form itself. At least that is what in my very novice opinion I was thinking.

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

Similar Threads

  1. Replies: 7
    Last Post: 07-01-2015, 10:29 AM
  2. Requery subform from main form
    By nswhit in forum Forms
    Replies: 7
    Last Post: 05-13-2013, 02:22 PM
  3. Replies: 2
    Last Post: 01-11-2013, 06:51 PM
  4. Requery subform after update of main form
    By gemadan96 in forum Forms
    Replies: 3
    Last Post: 10-17-2012, 02:33 PM
  5. Replies: 3
    Last Post: 10-10-2011, 06:33 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