Results 1 to 2 of 2
  1. #1
    thomas398 is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2009
    Posts
    1

    Combo box match works on subform not inside form

    I'm new to access 2007 forms and I'm sure this is an easy question:

    I want to make a selection in one combo box and have the other show the matching info (program => program_cost). The bound boxes are on a subform for an invoice table. The program-price combinations are on a seperate lookup table Thec_Program.

    This code on the program_cost box works when only the subform is open :

    SELECT THEC_Program.Program_Cost,THEC_Program.Program,THE C_Program.ID
    FROM THEC_Program


    WHERE (((THEC_Program.ID)=[Forms]![SUBFORMNAME]![Program]));

    When the full form is open, the subform is a tab and the above code returns a parameter error it doesnt recognize the subformname.

    So I chage to this:

    SELECT THEC_Program.Program_Cost, THEC_Program.ID, THEC_Program.Program
    FROM THEC_Program
    WHERE (((THEC_Program.ID)=[Forms]![FORMNAME]![Program]));

    No parameter error but the drop down is blank.... Why is query coming back blank?

    I have an AFTERUPDATE on the program box. On the subform this allows for multiple changes.

    Private Sub Program_AfterUpdate()

    Me.Program_Cost = Null
    Me.Program_Cost.Requery
    Me.Program_Cost = Me.Program_Cost.ItemData(0)

    Thanks for any help.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    See if this link helps you with the syntax.

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

Similar Threads

  1. Replies: 6
    Last Post: 06-03-2009, 02:01 PM
  2. Import from MS Works
    By jerald in forum Import/Export Data
    Replies: 0
    Last Post: 03-17-2009, 08:00 AM
  3. Replies: 1
    Last Post: 03-02-2009, 11:54 AM
  4. Replies: 0
    Last Post: 08-17-2008, 12:19 PM
  5. Replies: 1
    Last Post: 03-31-2008, 09:53 AM

Tags for this Thread

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