Results 1 to 10 of 10
  1. #1
    michael0610 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2011
    Location
    Asheboro, NC
    Posts
    5

    Combo box requery issue in tabbed form mode

    I have an application where I have developed a tabbed user input form with several tab pages to populate several tables with data using the master/child linking philosophy. There is one subform in particular that has two combo box fields that are related. I have them both set up to display value choices based on an undelying query. I want to restrict the scond box's choices based on the choice made in the first box and have written the following code to be applied after the first combo box is updated.



    Private Sub RteGroup_AfterUpdate()
    Form_Routing.OpType = Null
    Form_Routing.OpType.Requery
    Form_Routing.OpType = Form_Routing.OpType.ItemData(0)
    End Sub

    This effectively limits my second combo box choices based on the selection of the first box. Her's my problem though. It works fine if I run the subform individually but if I run it as part of the master form in tabbed mode I get an "Enter paramter value" dialog box asking for the value of the first combo box. it appears the requery is not functioning under the tabbed mode. can anyone help with this? Thanks!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    The reference to the first combo in the query would have to be adjusted to the syntax for a subform:

    Forms Refer to Form and Subform properties and controls
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    michael0610 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2011
    Location
    Asheboro, NC
    Posts
    5
    Thanks for the info. Here's what I tried based no the link you sent:

    Me!OpType = Null
    Me!OpType.Requery
    Me!OpType = Forms!Routing.OpType.ItemData(0)

    This is coded to the afterupdate event for the first combo box control on the subform. I still get the parameter prompt. Obviously I have a syntax issue of some sort but don't know what I need to change.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    What is the row source of OpType? I suspect that's where the form reference is.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    michael0610 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2011
    Location
    Asheboro, NC
    Posts
    5
    The row source for 'OpType' is referencing a query against another table to give it its choices. I am using a where statement in this query to restrict the 'OpType' choices to ones where a field named 'Opercode' = [Forms![Routing]![Rtegroup] and is typed exactly like this.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    That's where I thought it was, and that form reference has to be changed when the form is a subform, as detailed in the link.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    michael0610 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2011
    Location
    Asheboro, NC
    Posts
    5
    That is definitely the issue. When I go into the query and run it within the master/subform it prompts me for the parameter but not when I open the subform independently and run the query. I jsut have nto figured out the proper syntax to change the paramter to so that it functions properly while running in master/subform mode. I tried everything that looked reasonable baseed off the link you sent but nothing works.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    This is the one you're after:

    Forms!Mainform!Subform1.Form!ControlName
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    michael0610 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2011
    Location
    Asheboro, NC
    Posts
    5
    That did it! Thank you so much for your help with this!

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    No problemo!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Unbound form requery issue
    By kparker in forum Forms
    Replies: 2
    Last Post: 06-28-2011, 04:22 PM
  2. Combo Box Requery Issue
    By Grizz2 in forum Forms
    Replies: 4
    Last Post: 06-02-2011, 08:14 PM
  3. Replies: 4
    Last Post: 01-14-2011, 10:37 AM
  4. Replies: 1
    Last Post: 03-26-2010, 10:32 PM
  5. Problems with list or combo box on tabbed form
    By kydbmaster in forum Forms
    Replies: 0
    Last Post: 02-20-2008, 01:33 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