Results 1 to 6 of 6
  1. #1
    accessmom is offline Novice
    Windows XP Access 2002
    Join Date
    Feb 2011
    Posts
    3

    Subform Combobox based on Main form combo box


    I am working on a database for milk sales to students. I am not getting any values for my subform combobox. I do not see any typos. The main form is called Sales and its combo box is FamID. The subform is called "Sales Details" and it's combobox is ChildID. When entering new data in the sales details subform I wanted to provide a dropdown box that only allows choices of children who belong to the family FamID that is selected via the combobox in the main form. The main form's control source is a Families table containing family info and the subform's control source is the "Sales Details Extended" query. The combobox ChildID's control source is ChildID but its rowsource is a query executed on a childrens table that contains children's names and childID were FamID=the FamID value of the main form combobox. If I open that query directly when the main form is open, it executes fine. When I open the main form with the subform I get no values either for the field nor for the drop down values. I am not terribly experienced programming in access so I assume I am missing something really obvious.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    In the OnEnter event of the ChildID ComboBox put:
    Me.ChildID.Requery
    ...and see what happens.

  3. #3
    accessmom is offline Novice
    Windows XP Access 2002
    Join Date
    Feb 2011
    Posts
    3
    Tried this and got the following error: The expression On Enter you entered as the event property setting produced the following error: A problem occurred while MILK DATABASE was communicating with the OLE server or ActiveX Control. The code entered is:

    Private Sub ChildID_Enter ()
    Me.ChildID.Requery
    End Sub

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Hmmm...I would start by *importing* your db into a fresh, new db and see if the problem follows. http://www.btabdevelopment.com/ts/impnew

  5. #5
    accessmom is offline Novice
    Windows XP Access 2002
    Join Date
    Feb 2011
    Posts
    3
    Thank you so much!! I am back in business.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    That's great! Are you ready to use the Thread Tools and mark this thread as Solved?

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

Similar Threads

  1. Replies: 29
    Last Post: 08-16-2011, 05:52 PM
  2. Replies: 5
    Last Post: 01-02-2011, 10:09 AM
  3. Replies: 1
    Last Post: 11-16-2010, 08:42 AM
  4. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  5. Replies: 6
    Last Post: 06-03-2009, 02:01 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